I have a line that works for static filename
This approach when used in a script works well.
Then i need a list of filenames to give this line.
I can get the list into a file by
then use
This will create a list of filenames.
This line will print each
I figured it would be easy to sub the print$i with my cat / sed line using $i as the filename.
This is SFU on a windows box.
any help from the experts out there?
Last edited by pludi; 12-09-2009 at 04:24 PM..
Reason: code tags, please...
Hello,
I'm using the awk command to insert empty columns on a tab delimited flatfile - which works fine -
=> But I'm not able to manage dynamicaly the filename of the awk output based on the source flatfile filename
I have 3 source flatfile:
flatfile_Jan-2016.csv
flatfile_Feb-2016.csv... (3 Replies)
Hello,
Is it possible to embed the command output to the replacement of sed? Say I need to replace all the blank lines with random strings:
input:
ACCTTCGTCTTCTGG
GCTTGAGATGGTCCA
GCAGGGCTAGTGACG
GACGAGTCTCTTGAC
ACCAAATCAAAGATCand output is:
>26aa36d934d44f06d15b3aab4645a602 $(date |... (9 Replies)
I came across this sed expression, and it does exactly what I want.
However I haven't got the faintest clue how it does it and thus do not feel capable of using it.
Can someone please explain how this expression works?
(I used it to remove html tags in a html file I was converting to text)
... (3 Replies)
Hi Experts,
Please let me know how to below situation:
Looking for:
sed "${linenum}d" $filename > $filename _Without_7C
Working Command:
sed "${linenum}d" A020820122200.tis2webGMNA001_GDS_DIDOut.txt > A020820122200.tis2webGMNA001_GDS_DIDOut.txt_Without_7C
appriciate if you can... (7 Replies)
Hello All,
I'm trying to write a script that will perform a dynamic match (of a dynamic variable) and set a variable to have the resulting (match) value.
The idea is that the environment variable to check ($1) and the regular expression to use ($2) are given as parameters.
For example,... (5 Replies)
sed -n '57p' filename
My file contains 57 lines ,the above command prints the 57 th line,but i want to assign the result of this to a variable, to compare with another line in a different file
suggest me some idea
if i directly use this to assign with variable like h=sed -n '57p' filename... (2 Replies)
Hi
The following code seems to work, but why am i getting an error message?
cscyabl@comet:(develop)> awk 'BEGIN {FS="|"}{print $2 >> $1}' test.sum
awk: A print or getline function must have a file name.
The input line number is 8. The file is test.sum.
The source line number is 1.
... (2 Replies)
Hi all,
I have a data file formatted as in the following line:
Achadd 0:35 1:35 2:35 3:40 4:40 5:40
I need the minutes converted to seconds; I wrote a script, min2sec, to do so for one datapoint. I was hoping to use sed as in the following code to call this script and... (4 Replies)
I'm trying to make a bash shell script that will allow a user to modify another file based on input they give. Maybe someone can see what I'm doing wrong here. I'm still pretty new at this...
Let's say my temp file contains this:
0 1 HELLO 3 4
And here's the code:
old=(0 1 3 4)
new=(zero... (2 Replies)
I've forgotten how to use a filename parameter
using sed inside a shell script. What I want to do is
replace a string inside a file with the name of
the file being processed.
I think this should work ..
for filename do
sed -e "s/xxx/$filename/" ...
...
done
Thanks!
Ps: ... (5 Replies)