10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have this line were I am selecting some fields from one file and creating a new file for the selected data.
awk -F "\"*,\"*" '{print $1"," $2}' folderone/list.txt > folderone/qlist.txt
This works, but then from this new file I want it to create a new file where it separates data:
$2 >5 it... (2 Replies)
Discussion started by: rluna
2 Replies
2. Shell Programming and Scripting
Hi All,
I am trying a shell script and need your help on taking the results to different output files.
I have tried the below code:
nawk '
{CNF = (length()-10)/7
printf "%9s", substr ($0, 1, 9)
for (i=0; i<=CNF; i++) T = substr ($0, 10+i*7, 7)
TMP = 100 - (T + T + T + T + T + T + T + T... (24 Replies)
Discussion started by: am24
24 Replies
3. Shell Programming and Scripting
Hi,
I have a following code in which I am unable to redirect to multiple files. Can anybody please help with some corrections
awk -F, '{ if ( substr($1,26,2)=="02" && substr($1,184,14)=="MTSCC_VALFIRST") {
array1++
array2++
array3++
}
else if (substr($1,26,2)=="03" &&... (4 Replies)
Discussion started by: siramitsharma
4 Replies
4. Post Here to Contact Site Administrators and Moderators
Hi All,
I am trying to redirect the grep output to multiple files, can you please help with that.
Below is the command im using to match my pattern
grep \<proxyType\>$PxyType $DIR/EndureFiles.json > File_Name*.json
Note : $DIR and $PxyType is already defined in my script
Im able... (0 Replies)
Discussion started by: Deena1984
0 Replies
5. Shell Programming and Scripting
I am trying to filter records based on number of "|", delimiter in my application. If number of "|" is greater than 14 its a bad record, else its a good record. I have to redirect output to two different files based on the if-then-else evaluation in AWK.
if number of “|” in file_0 > 14
... (2 Replies)
Discussion started by: siteregsam
2 Replies
6. Shell Programming and Scripting
Hello all,
I have the following 2 questions..
1) I would like to capture the output of an echo command to 2 different files at the same time. This does not seem to work. Any ideas?
echo ==== started on `date` ==== >> res1.log res2.log
2) Would it be possible to just get the 5th... (2 Replies)
Discussion started by: luft
2 Replies
7. UNIX for Dummies Questions & Answers
Hello,
I have a set of data (comma seperated) that I want to save to multiple files according to one of the fields in the data set.
I can easily do this with the following script:
BEGIN { FS = OFS = ","}
NF {print $0 >> ($2 "" ".csv")}
It works perfectly on a set of dummy data I have set... (8 Replies)
Discussion started by: pfft
8 Replies
8. Shell Programming and Scripting
I have a simple script written in awk whose purpose is to go through some php files and replace some strings. Naturally, I want the changes to be written out to the files. The script looks generally as follows:
{
gsub(/'replacethis'/, "with this"); # a bunch of these
print $0 > FILENAME
}... (3 Replies)
Discussion started by: face1
3 Replies
9. Programming
Im currently using execl() to run the ls command and redirect the output to a text file. Unfortunately, when I check the text file, no information has been written to it.
I am calling execl() with the ls command like this
execl( "/bin/ls" , "-al" , '>' , "dirlist.txt" ,(char *) 0 );
... (5 Replies)
Discussion started by: JamesGoh
5 Replies
10. UNIX for Dummies Questions & Answers
If I wanted to redirect output to multiple log files, what would be the best way to do that?
echo "Unix is awesome" >>unixgod.log >>unixgod.log (3 Replies)
Discussion started by: darthur
3 Replies