Thank you for trying to use code tags. You got it nearly right. Next time use square brackets, [ ] , not triangular brackets, < >.
expl: That is a useless use of backticks. You don't need echo's help to get the value of a variable. You probably need { } to get the variable to expand properly however. ${filename} >> ${filename}-output.txt
This can be made much simpler by feeding the filenames right into awk. No loop necessary. It can even change the filename itself. It will work right with multiple files because FNR counts the line number inside a file, not the total numer of lines (NR).
FNR>0 will always print, incidentally, because FNR will always be a nonzero number. The very first line is 1. If you want it to skip the very first line of each file, that willl be FNR>1
Thank you for trying to use code tags. You got it nearly right. Next time use square brackets, [ ] , not triangular brackets, < >.
expl: That is a useless use of backticks. You don't need echo's help to get the value of a variable. You probably need { } to get the variable to expand properly however. ${filename} >> ${filename}-output.txt
This can be made much simpler by feeding the filenames right into awk. No loop necessary. It can even change the filename itself. It will work right with multiple files because FNR counts the line number inside a file, not the total numer of lines (NR).
FNR>0 will always print, incidentally, because FNR will always be a nonzero number. The very first line is 1. If you want it to skip the very first line of each file, that willl be FNR>1
Hi
I have two text files. The first file is TEXTFILEONE.txt as given below:
<Text Text_ID="10155645315851111_10155645333076543" From="460350337461111" Created="2011-03-16T17:05:37+0000" use_count="123">This is the first text</Text>
<Text Text_ID="10155645315851111_10155645317023456"... (7 Replies)
I am trying to use the text of one file as a text file name with and the text of another as the contents of that text file. Is this possible? Thank you :).
For example, in the two files attached, target.txt has:
1.txt
2.txt
and out_parse.txt has:
13 20763642 20763642 C G... (5 Replies)
Hi all,
I want to do an Unix Script to save the 'nmon' output on a text file and I don't know how to do it.
I need a Script for each monitoring and also one to multiple monitorings.
Thanks (6 Replies)
i have a text file consists of different file names like:
line 1: lib/libIMb.so message broker file
line 2: lil/imbdfg.lil message broker file
i need to extract libIMb.so and imbdfg.lil files from those lines and save them in a variable. so that i can search for... (9 Replies)
Currently I have a perl code to combine two different files.
#! /usr/bin/perl -w
use strict;
open FP1,"A.txt";
open FP2,"B.txt";
my ($l1,$l2);
while(1)
{
$l1=<FP1>; chomp $l1;
$l2=<FP2>; chomp $l2;
last unless(defined $l1 or defined $l2);
print "$l1 $l2\n";
}
close FP2;... (4 Replies)
Hi Guys,
I have blank file A.txt
I will run the script xyz.sh
First i want to open a.txt file...
Now i will enter some data like
XYZ
ABC
PQR
..
Save it and keep continue my script....
END of my script.
Thanks (1 Reply)
Hi i have wriiten a script which fetches the data from text file, and saves in the output in a text file itself, but i want that the output should save in different columns.
I have the output like:
For Channel:response_time__24.txt
1547 data points
0.339
0.299
0.448
0.581
7.380
... (1 Reply)
needa c program to extract text between two delimiters from some text file.
and then storing them in to diffrent variables ?
text file like 0:
abc.txt
=========
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass
aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Hello all
im using allot with the method of getting file list from misc place in unix and copy them into text file
and then doing misc action on this list of files using
foreach f (`cat file_list.txt`)
do something with $f
end
can I replace this file_list.txt with some place in memory? ... (1 Reply)