Programming :: Pasting Multiple Cut Outputs To A Tab Delimited Output File?

Sep 4, 2010

I have a requirement like this:Cut the characters from each line of a file with following positions: 21-24, 25-34 ,111-120.Thse fields now need to be placed in a tab delimited output file.Currently this is how I am achieving it:

#!/bin/sh
cat newsmaple.txt | cut -c 21-24 > out1.txt
cat newsmaple.txt | cut -c 25-34 >out2.txt

[code]....

View 1 Replies


ADVERTISEMENT

Programming :: PHP Outputs Metadata Or File Information At The Top Of Its Output

Sep 10, 2010

Consider this PHP Script or just skip to the Output:

Code

Code:
-bash-2.05b# cat myDate.php
#!/usr/bin/php -q
<?php

[code]....

View 10 Replies View Related

Programming :: Concatenate The Output To Comma Delimited?

Nov 23, 2010

I would like to create csv output from an ipcalc calculation.

Code:
[me@host scripts]$ ./ipcalc 192.168.30.40/255.255.255.248
Address: 192.168.30.40 11000000.10101000.00011110.00101 000

[code]....

View 1 Replies View Related

General :: Output Pid's From Ps To A Comma Delimited File?

Apr 7, 2010

need to monitor pecific processes over a time frame in terms of the amount of memory and cpu usage it utilizes. I can do this using the top -p <pid> option and using ps to retrieve the pid's. However, seeing that the pid's might differ and it needs to be run on about 13 different machines, I would like to write a script for this that can be run at set intervals. My problem that I have is this:

- When running top -p <pid> I can specify a comma seperated list of the processes required to monitor at that specific time.

- I can use ps -ef | grep <process> | grep -v grep| awk '{ print $2 }' to retrive the list of pid's and output this to a file.

However, how can I output these to the file as a comma seperated list without having to manually do this every time? The reason for this is (an example), lets say I want to monitor the cpu and memory usage of postgresql as well as all its child processes, then I would ps grep for postgres and get the list of pid's for instance.This list then needs to be passed to top -p as a comma seperated list of pid's I suspect that awk or sed might have some options available for this but I do not know this well enough.

View 11 Replies View Related

General :: Multiple Grep Outputs Appended To Single Row Of CSV File?

Sep 12, 2010

how to update a series of values from multiple grep commands outputs to be appended to a single row of a csv file? Work on a linux envir. The values from grep output will be numeric values.

Output sold look like:

1,3,4,5,7,0,5

Each of these values will be odtained from multiple grep commands piped with wc -l Is it possible to update a single row of a csv file if so pleas ehelp me with the command to be used to redirect the output into the csv file

View 5 Replies View Related

Programming :: Searching Pattern In Tab Delimited File Using Grep

Mar 4, 2010

Suppose i have a file(1.txt) separated by TAB delimiter in a line

1 B AB 2
2 C AB 2

if I need to search for the records having B?? using grep.If i need to perform multiple search like line having "C and AB" or "B and AB"??

View 5 Replies View Related

Programming :: Using Sed To Remove Line In A Comma-delimited File?

Mar 10, 2009

I have a script that output all my data in to a comma-delimited file separated by ";"

Current Output:

Quote:

"SAP 1117A";10.94.1.7;239.234.1.12;0;0;0;0;0;3;172.31.207.45;""
"";NA;239.192.1.50;0;0;0;0;0;3;172.31.207.61;""
"";NA;239.192.1.50;0;0;0;0;0;3;172.31.207.62;""

[code]...

I would like to remove all lines that have an NA in the second field.

New Output

Quote:

"SAP 1117A";10.94.1.7;239.234.1.12;0;0;0;0;0;3;172.31.207.45;""
....

View 4 Replies View Related

Programming :: Bash - Reading Csv Delimited File To Array And For Further Manipulation?

Jan 6, 2010

I am trying to do this:

1. Read csv delimited file line1 and store all values in array

2. Use the values stored in the array and replace values in other text file with them

3. read line2 in the cvs file and repeat the process

4. Do above for all lines in the cvs file

for example:

file1.cvs content:

text1,text2,text3,"text 4"
a1,a2,3,"a 4"

file.txt content:

some text $array1$ some text
some text $array2$ some text

1. read line 1 - text1,text2,text3,"text 4" put each value in array X[] lines that contain spaces in cvs will have double quotes

2. read x[1] and replace value $array1$ (in file.txt) with x[1]read x[2] and replace value $array2$ (in file.txt) with x[2] and so on

Can above be accomplished in BASH and how?

View 1 Replies View Related

Programming :: Move Line Of Pipe Delimited Flat File If Field 27 = Sold?

Sep 26, 2010

I have a pipe delimited flat file, field 27 is price. I would like to move items marked sold to a new file every couple months.

awk -F"|" '$27 == "SOLD" {print $0}' awktest2.data >> awkout2.data

Allows me to write line to new file but I need to delete the original line, I also want to make sold case insensitive tried [Ss][Oo] with no luck

View 4 Replies View Related

Ubuntu Multimedia :: Multiple Audio Outputs Not Available

Oct 28, 2010

I've searched high and low, and can't seem to find a solution to this. I'm running a Dell Inspiron with an HDMI output with 10.10 through the tv. I want to get HDMI sound output for VLC, but I also want S/PDIF output (to the stereo) for Musicplayer. I can test and use the HDMI in the sound preferences sound/preferences/sound, but when I try to do the same for the internal card and click 'test speakers' the sound program closes itself. When the machine was a windows machine, it had PowerDVD outputting to the TV and Mediaplayer outputting to the stereo. I'm aiming for a similar set up in Ubuntu.

View 1 Replies View Related

General :: Piping Data To Multiple Outputs?

Mar 29, 2011

I remember there was a command that would allow me to pipe data to an app and the use the | operator to pipe it into yet another app.

foo fooArg | Iforget app1 | app2

I forget what this command is but it pipes the data from foo into app1 and app2.

View 3 Replies View Related

Ubuntu Multimedia :: Pulse Audio Multiple Outputs?

Apr 3, 2010

I've searched and searched and can't find a straight answer about this. I want to sent the same signal out of the digital output and one of the analog outputs on the soundcard (Intel HDA) on my motherboard. I'm using ALSA and Pulse Audio.

View 5 Replies View Related

Programming :: Bash Scripting - Output As Multiple Files?

Jan 26, 2011

I have wrote a 1 line command that parses a file, locates the IP Address in the file and then trims the output the way I want it, and then sorts numerically and by uniqueness and then >> appends to output.txt

I can get all the IP's into 1 file "output.txt", but what I am really looking for is some type of way to create a text file, for each IP it finds labeled xxx.xxx.xxx.xxx.txt and also put that ip address into that file..

xxx.xxx.xxx.xxx = the ip address it finds

View 14 Replies View Related

Software :: Rear File Names To Creat A Comma Delimited File?

May 22, 2010

I am looking for an application that will read the file names in a folder and generate a comma delimited file. I want then to import the comma delimited file contests to a spread sheet such as open office.I hava a number of PDF files generated from a scanner, each file with its own scaner generated file name. I want to put these into a data base so I can add the title and other reference information to provide a data base.

View 7 Replies View Related

Programming :: Redirect The Output To Multiple Files Without Displaying It To The Screen?

Oct 26, 2010

To redirect standard output to multiple files:

Code:

echo Test | tee file1 file2

My problem is that the word "Test" still displays to the screen? I want same effect as:

Code:

echo Test > file1

but with multiple file redirection.

View 3 Replies View Related

Programming :: BASH - Output Of Snmpget With Multiple OIDs Into Separate Variables

Jul 7, 2010

I have a problem with snmp answers being empty or having spaces.

What I already have:

#get all interface indexes (if you wonder - I'm working for a cable company and different cablemodems have different number and types of interfaces):

The problem is the physical address which is sometimes empty and the description which has spaces. So I'm doing 2 snmpgets which is slower than 1 snmpget (sometimes I have up to 18 interfaces).

I'm trying to explain it a bit simpler.

Interface 5 gives me back the following lines:

Ethernet CPE Interface

Now the first line should go into variable ifadm,
2nd line should go into variable ifoper,
3rd line should go into variable ifspeed,
4th line should go into variable iftype,
5th line (which is empty) should go into variable ifphys and finally
6th line (which has spaces) should go into variable ifdescr

View 4 Replies View Related

Programming :: Join 5 Lines Blocks Comma Delimited?

Nov 26, 2010

I have been searching previous posts but could not find an example which works with my data. I think I might be the spaces in my fields. I have a massive data file and need to join 5 line blocks separated by a comma.

Code:

2
111.222.333.444
host.edu

[code].....

View 8 Replies View Related

General :: File Output Redirection - Redirect Stream To Multiple Files?

Dec 7, 2010

I'm working on some scheduled task script files to keep nightly backups of some of our database information in place, and it's a bit annoying when they blow up. I know how to redirect stdout and stderr to a flat file I can view when I come in, and I know that 2>&1 maps them both to the same file (whatever was named in 1). However, I'm running into some cron-time situations where it's easier to have the two streams together, and other cron-time situations where it's easier to have them separated. I can't really tell which is going to happen; is there some way I could create both kinds of output file for my scripts, so that I've got a std_err only file and an interleaved std_out/std_err file?

Note: I've looked at the 'tee' command, but I don't think it will work for what I'm after. 'tee' appears to only work with stdout; I'm trying to work with stderr.

View 5 Replies View Related

General :: Count An Item In A Tab-delimited Txt File?

Mar 6, 2010

in a tab-delimited file, such as:

Code:
111aIab
222bIIbc

[code]...

View 3 Replies View Related

Programming :: Pasting A Png Image On Another Through CAIRO Library?

Mar 3, 2010

I could easily paste images on each other in Python through PIL (Python Imaging Library)
Now I need to use Cairo with C++ for the above purpose.I have referred the following but couldn't ge

View 5 Replies View Related

General :: Parsing Delimited File And Variable Scripting?

Sep 23, 2010

I did some searches and after a few hours was able to get what I needed. What I didn't find was a fully encompased means of what I'm used to in the windows world in working with delimted files. Hopefully this is helpful to others and if there is something better or leaner way, even better.We have an issue where managing printers, just viewing on RHEL w/ sys-conf-prtr we lose any number of, up to ~30 printers from lpadmin. Rather than stare and compare to find the missing ones, I wanted to make an intuitive script. This is what I came up with.

Code:
#!/bin/sh
while IFS="," read Prntr IP; do

[code]...

View 3 Replies View Related

Debian :: Copy Pasting A File Via Ssh Possible?

Mar 28, 2011

Is it possible to use the cp command to copy a file from computer A to computer B?

Also, assuming that it is possible, does Linux SSH add extra (=its own) encryption via the file transfer or is it solely reliant upon my WIFI's encryption?

View 7 Replies View Related

General :: Program That Reads Multiple Pipes / File Descriptors And Writes To Standard Output

Feb 23, 2011

Is there already a program that reads multiple pipes or file descriptors and writes to the standard output (not splitting lines).Like cat, but reading all files simultaneously and preserving lines.It is needed to avoid coding of select/epoll loops or using multithreading in simple programs. Like "select loop for bash".

View 1 Replies View Related

General :: Check Quality Of A Specific Column In A Tab-delimited File?

Mar 8, 2010

shell commands for such two goals?

In a tab-delimited file,

Code:
1aIa11aa
2bIIa22aa
1cIIIaabcaa
4dIVaabcaa

1. How can I find the non-unique values in the 1st column (1, in this case)?

2. How can I find the non-integer values in the 5th column (abc, in this case)?

View 3 Replies View Related

Programming :: Shell Scripts For Cutting And Pasting Part Of Data?

Mar 17, 2011

I have a tab-delimited txt file as below. It is part of the original file.Quote:

##Hello
##Welcome
#C1 C2 C3

[code]....

View 13 Replies View Related

Programming :: Variable String File Base - Output File Doest Not Exclude The Values In Grep -av

May 1, 2011

My script.

This is may script:

Code:

Problem: Output file doest not exclude the values in grep -av

View 3 Replies View Related

Programming :: Sed - Save Output To File With Filename From Content Of Another File?

Feb 28, 2011

My employer issues pdf files with everyones work schedules. I copy the content and save it as plain text in a file called unformatted (hope to be able to automate this step someday). Im working on a SED script that reduces unformatted to only display what I want to see and saves the result in a file Iïve named formatted. After that I have to manually copy formatted and save it with that days date as a filename e.g. 2011-02-25 or whatever day is scheduled in the pdf, for use on a mobile device (Nokia N900). I noticed that the date occurs on certain lines in the file so I added a line like:

sed -n 's/^Date: (201[1-9])/([0-1][0-9])/([0-3][0-9]).*/1-2-3/p' < unformatted >theDate
That creates a file theDate with the date in it that I wish to use as the filename for this particular instance. So I would like to skip the file formatted all together and have the sed- script write to a new file using the content of the Date as a filename, but how do I make that happen? And of course it would be more elegant if I could skip the intermediate theDate file as well.

View 4 Replies View Related

Programming :: Execute The String That Sed Actually Outputs?

Aug 2, 2010

I've been able to get the right output that I need from sed, but how can I execute the string that sed actually outputs?

View 3 Replies View Related

General :: Get Socket.h Header File / Copy Pasting This Header File In 'incl' Directory Allow To Use It In The Program?

Apr 22, 2011

where can i get socket.h header file? will copy pasting this header file in 'incl' directory allow me to use it in the my program?

View 1 Replies View Related

Programming :: Catch Some Outputs In Two Different Log Files In Bash?

Jan 26, 2009

I want to catch some outputs in two different log files in bash, file simple.log and all.log So far, the script is started like this:

Code:

xterm -e "(./myscript.sh | tee -a simple.log) >& all.log"

What I want is:

- In simple.log, I want all the stdout but WITHOUT errors.

- In all.log I want BOTH stdout and stderr.

So all is ok, and the output becomes:

all.log

Code:

starting copying files
mv: cannot move ... : permission denied
copying completed
simple log

Code:

starting copying files
copying completed

But, in the new xterm, I'm loosing stdout. There is no output.How can I have the files logged as they are but also have the stdout in the xterm.

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved