10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Gurus,
I need to remove comma from first and last line. I tried below code, but no luck. It only remove first line.
Gurus, please help.
awk -F"," '{if(NR==1||NR==$NR) print $1; else print $0}' TEST
sampe file:
ABC HEADER TOTAL RECORDS ARE 2.00,,,,... (13 Replies)
Discussion started by: ken6503
13 Replies
2. Shell Programming and Scripting
Hi,
How can we remove the comma from the end of each line.
I have a csv file in below format.
file.csv
Name,age,gender,location,
Joel,18,M,Newyork,
Monoj,21,M,Japan,
Litu,23,M,turki,
Expected o/p
file1.csv
Name,age,gender,location (4 Replies)
Discussion started by: Litu19
4 Replies
3. Shell Programming and Scripting
Hi
I need to remove "|" char when it's the last char of the line.
Input file:
generoso|desprendido|altruista|
abnegar|ceder|sacrificar|
abocetado-da|esbozado|
apuntado|insinuado|incompleto
abocetar|esbozar|bosquejar|
diseņar|delinear
------------------------ output need ---
... (11 Replies)
Discussion started by: lookoo
11 Replies
4. Shell Programming and Scripting
how to Remove comma as last charector in end of last line of file:
example:
input file
---------------
aaaaaa,
bbbbbb,
cccc,
12345,
____________
output file :
-----------
aaaaaa,
bbbbbb, (6 Replies)
Discussion started by: RahulJoshi
6 Replies
5. Shell Programming and Scripting
Hi,
my file has below details and I want remove the # char from only specific line.
#TEST:00:START
#TEST1:01:INPROCESS
#TEST2:02:ABOUTTO
#TEST3:03:COMP
i.e if want remove the # from 2nd line then file to be updated as
#TEST:00:START
TEST1:01:INPROCESS
#TEST2:02:ABOUTTO... (6 Replies)
Discussion started by: sandyrajh
6 Replies
6. Shell Programming and Scripting
Hi All,
I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end.
Before:-
File Name:- File1.dat
102 121340560... (10 Replies)
Discussion started by: lancesunny
10 Replies
7. Shell Programming and Scripting
Hi I am working on a bash script and would know how to use cut or sed to remove
(F/.M/d h) from a text file.
Before
1 text to save (F/.M/d h)
after
1 text to save
Thanks in advance (5 Replies)
Discussion started by: pelle
5 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I have a file which has records which end with a comma.
for example:
My file looks like
1234,
5678,
3455,
3566,
4444,
9999,
I need to remove comma for the last line in the file so that my file should look like:
1234,
5678,
3455, (5 Replies)
Discussion started by: sandeep_1105
5 Replies
9. UNIX for Advanced & Expert Users
HI all,
I have a file with following data - test1
"ABC,D",1234,"XYZ,QWER",1234
"SZXA",9870,"ASD,QWERT",234
"XZ,SD",9478,"ADCS,AXZ",876
"WESR",8764,"AQZXAS",9888
"WESR",9898,"WESDRTSAW",3323
I need to get rid of unnecessary commas in fields having double quotes.
Ouput -
... (1 Reply)
Discussion started by: sumeet
1 Replies
10. Shell Programming and Scripting
Hi
Can anyone tell me how can i remove new line character from a string.
My requirement is to read a line from a file and store it to a string.
read line
string1=$line
read line
string2=$line
echo $string1$string2
The result i am getting in different line. i want the output in the same... (1 Reply)
Discussion started by: sreedivia
1 Replies