Can I use my own variables within awk and sed for example:
I've written a while loop with a counter $i and I want to use the value of $i within sed and awk to edit certain lines of text within a data file.
I want to use :
sed '1s/$/texthere/g' data.csv
Like this:
sed '$is/$/$age/g' data.csv... (5 Replies)
Hello,
I am a newbie to linux and struggling to find a better way to append a column in a text file.
Here is the file i want to modify: It has 8 columns (and thousands of rows). I want to append the first column by adding "chr" infront of the numbers. Some rows have a string in the first... (4 Replies)
Hi there,
I'm wondering the best way to go about this. I have a file which is fairly specific in its format, but it has some options in it that mess up what I need. I'll give you an example of a couple of lines:
Bob D
Thomas D/F
Alice A/F
Michael A/D/F
John Michael B
Bachman Turner A/D... (7 Replies)
Hi,
I am trying to print a specific line in a file through sed or awk. The line number will be passed as a parameter from the previous step. My code looks as below.
TEMP3=`sed -n '$TEMP2p' $FILEPATH/Log.txt`
$TEMP2, I am getting from the previous step which is a numerical value(eg:3).
... (2 Replies)
Hello I am hoping you may help.
I am not sure how to go about this exactly, I know the tools but not sure how to make them work together.
I have two SED commands that I would like to run in a shell script. I would like to take
the manual input of a user (types in when prompted) to be used... (4 Replies)
Dear Friends,
I have a file in which lists State and Phone numbers. Does anybody have a solution in which to take the data from col3 and place it on col2?
AK 2988421640 9077467107
AK 2998266711 2069239034
AK 2983804242 2069239034
AK 2960407849
AK ... (3 Replies)
Experts,
Can you please help how to get the output that are written just below "bad"
calls badcalls nullrecv
439486 54 0
badlen xdrcall dupchecks ... (6 Replies)
Hi i have a control file which i need to read. It is ',' separated. the 3rd parameter will be ';' separated.
I have 2 files:
/home/orig.txt
/home/join.txt
I need a O/P file name based on firstparameter_1.txt and it should have the content of /home/orig.txt
and appended content from... (2 Replies)