10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello All,
I have this script to awk IP to new file.
#awk '/myip|yourip/ {sub(/...\....\....\..../, newip)}1' newip=$IP existing.txt > new.txt
When existing.txt has myip=192.168.123.123 and $IP has 192.168.12.12, the awk script is not working. But while I add zero left padding to $IP i.e,... (3 Replies)
Discussion started by: Shaan_Shaan
3 Replies
2. Shell Programming and Scripting
When the line contains abc, it will goes to the next line and substitue the MM to NN
bc 23 33
abc 23 33
ddd MM xx
dff MM 33
cat xxx |awk '{if ($0~/abc/){getline;sub(/MM/,"NN")}{print}}', It doesn't show "abc 23 33
bc 23 33
ddd NN xx
dff MM 33
bc 23 33
abc 23 33
ddd NN xx... (1 Reply)
Discussion started by: yanglei_fage
1 Replies
3. Shell Programming and Scripting
dear,
I have below file called folderlist.txt
# ParentFolder environment_flag SubFolders
triss 1 checksum
bookstructure 1
fx 1 checksum_GMDB
I have a script which which will create the folders under... (3 Replies)
Discussion started by: manas_ranjan
3 Replies
4. Shell Programming and Scripting
using awk to substitute data in a column delimited text file
hello i would like to use awk to do the following calculation from the following snippet.
input file
C;2390 ;CV BOUILLOTTE 2L 2FACES NERVUREES ;1.00 ;3552612239004;13417 ;25 ;50 ; 12;50000 ; ; ... (3 Replies)
Discussion started by: iindie
3 Replies
5. Shell Programming and Scripting
I have a large csv file that looks like this:
The 3rd field is a unix time stamp that I want to convert to human readable.
I wrote a bash script with this code:
IFS=$','
cat $1 | while read ID user DATE text flags read; do
echo -e "$ID,$user,$(date -d @$DATE),$text,$flags,$read... (3 Replies)
Discussion started by: stumpyuk
3 Replies
6. Shell Programming and Scripting
I am having the following problem. I am having a lot of files (test_1_01.hea, test_1_02.hea, etc) with the content:
project_directory /net/1/d_1/5/
tmp_directory /net/1/d_1/5/
material_directory /net/1/d_1/5/
And I have to substitute the filepaths with new counted ones where the... (3 Replies)
Discussion started by: ergy1983
3 Replies
7. Shell Programming and Scripting
I want to reformat the following:
ID1 ID001 0 0 2 1 GG TC GG CT GG AA AA AG
ID2 ID002 0 0 2 2 GG 00 AG CC GG GG TC CC
I want to replace only:... (1 Reply)
Discussion started by: genehunter
1 Replies
8. Shell Programming and Scripting
I'm trying to efficiently combine the fields of two vectors (vectors b and c) into a new vector (vector d) as defined by instructions from a 3rd vector (vector a). So vector a has either a 1 or 2 in each field specifying which vector (b or c respectively) should go into that field. Vector a is... (4 Replies)
Discussion started by: LaTortuga
4 Replies
9. Shell Programming and Scripting
Hi,
I am new to this forum and my script skills are very weak.
I have this file (file 1) that contains 3 columns (tab delimited):
kyle start stop
john start stop
joe start stop
And I want to replace name (column 1) from another file. This other file has two columns, one is the... (4 Replies)
Discussion started by: kylle345
4 Replies
10. Shell Programming and Scripting
Hi there all,
I am using a line to get some replys from my PS
I do
ps -ef |awk '{printf $9}'
But my result is 1 big line.
No spaces between the lines or someting
for example:... (2 Replies)
Discussion started by: draco
2 Replies