Received a message asking me to explain my awk, so I am posting it here for the good of the community.
awk ' ===> starts awk
{ if (((NR>=2)&&(NR<=8)) || ===> checks if line # (>=2 AND <=8) OR
(NR==17) || (NR==30)) { ===> if line # =17 OR line # =30
print substr($0,2,99) ===> if conditions met,
===> print the line beginning @ position 2
} else { ===> if conditions not met
print ===> print the line of text as-is
} ===> end the section within awk
}' file162 ===> end the awk commands, & provide the input file
Surpisingly, I've only found information regarding removal of files with special characters in the name. My problem is this: files are downloaded to my Unix box from mainframe, and each one has a pound sign as the first character of the filename.
original:
#FONT
what I need:
FONT
... (4 Replies)
Can someone help me with this command?
I want to replace amount fields which are in the format $99.99 to 99.99 in a large data file which is within a HP box.
I use Vi editor and tried this command
:1,$s//$///g
And this does not seem to work
Also, I want to replace ^M with spaces in the... (1 Reply)
I'd like to make a script that I can execute every time I sign on to my linux box that keeps track of the time and allows to me to add a remark to a file. So basically once I log in, I run the script, and it outputs the date and time to a text file (log.txt). But that isn't my problem.
I need... (1 Reply)
Hi,
Can anyone help me parse the code bellow. I have a file with several lines. I ant to put an 'X' on the lines that ONLY have an '=' in them ignoring comma's, spaces etc..
So:
/*
,
systems.menuLabel.new=New
systems.menuLabel.new.mnemonic=N
*/
Would look like:
/*
,
... (9 Replies)
I'm trying to enter ¥ yen sign which is a part of a complex password in terminal putty thru bash shell
how can i type such character in terminal or even write it in a file as a stdin for the client
thanks
---------- Post updated at 05:38 PM ---------- Previous update was at 02:07 PM... (0 Replies)
I have a binary (hex) file I need to parse to get some data which are encoded this way:
.* b4 . . . 01 12 .* af .* 83 L1 x1 x2 xL 84 L2 y1 y2 yL
By another words there is a stream of hexadecimal bytes (in my example separated by space for better readability). I need to get value stored in... (3 Replies)
PFB my shell script which reads a csv file to process it
###############################################
fn_java(){
echo JAVA_TOP is $JAVA_TOP
echo "cp $filename $filepath/$filename"
cp $filename $filepath/$filename
}
#########################################... (9 Replies)
Please help me, wasted hrs:wall:, to find this soulution:-
I need a command that will work on file (xml) and replace multiple occurrence (more than 2 times)
Examples
1. '==='
2. '===='
3. '======='
should be replaced by just '=='
Note :- single character should be replaced. (=... (13 Replies)
HI
I'm terribly new to perl .. I;ve been trying to use this command to search and replace entries in a file
I tried this and it works
perl -p -i -e 's/old/new/' filename
Problem is that I have a list of email addresses and I need to serach and replace the entire email address as my... (5 Replies)
I have an xml file which is generated in a single line an looks like this
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?><Batch_Id="1999996" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><some data....><some data....>closing lines......
I need to have a separate line... (3 Replies)