Visit Our UNIX and Linux User Community


delete first two " char


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers delete first two " char
# 1  
Old 07-28-2009
delete first two " char

Hi,

I need to delete the char " from a line but only the first 2

example:

JPY,0,XS0122118481,CCDO,IFI_CCDO,"2,210,000,000","2,210,000,000",0.00

result:

JPY,0,XS0122118481,CCDO,IFI_CCDO,2,210,000,000,"2,210,000,000",0.00

How may I go about doing this?

Thanks
# 2  
Old 07-28-2009
This works but it's fugly. I'm sure someone will come up with something better. Say your lines are in a file called "testfile":

Code:
sed s/\"//1 testfile | sed s/\"//1

# 3  
Old 07-28-2009
Bug

Quote:
Originally Posted by mglenney
This works but it's fugly. I'm sure someone will come up with something better. Say your lines are in a file called "testfile":

Code:
sed s/\"//1 testfile | sed s/\"//1

Smilie Thank you so much Smilie
 

Previous Thread | Next Thread
Test Your Knowledge in Computers #631
Difficulty: Medium
iPhone OS 1.0 was first released with great fanfare during the US Super Bowl in 2007.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

VI editor keeps automatically adding new lines with "P" char ..

Hello, I am on AIX operating system. Recently, when I open any file in vi editor, it starting adding lines automatically with "P" char in the beginning of each line. This also happens when I open crontab ( crontab -e) ..I have looked in to my .profile and nothing has changed in there for such... (4 Replies)
Discussion started by: shethkb
4 Replies

2. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

3. Shell Programming and Scripting

Move a line containg "char" above line containing "xchar"

Okay, so I have a rather large text file and will have to process many more and this will save me hours of work. I'm not very good at scripting, so bear with me please. Working on Linux RHEL I've been able to filter and edit and clean up using sed, but I have a problem with moving lines. ... (9 Replies)
Discussion started by: rex007can
9 Replies

4. Programming

What is use of "char __user *buf"?

I have seen several function containing "char __user *buf" as parameter. this is disturbing my basic knowledge of c the basic syntax says char *buf means buf is a pointer which points to a char now what does char __user *buf means? Please reply (2 Replies)
Discussion started by: kg_gaurav
2 Replies

5. Programming

Small query regarding function "char * strerror(int errnum)"

As this function returns the address of the string corressponding to the errno value provided to it. Can someone please let me know where, in the memory, it could be (on freeBSD). The MAN page tells under the BUG section that "For unknown error numbers, the strerror() function will return its... (5 Replies)
Discussion started by: Praveen_218
5 Replies

6. Programming

"char" memory layout problem!

In the following code, why the final result of "usC=cA+(char)ucB;" is 0xFF00? In my opioion the memory layout of cA is "10000000" and (char)cB is "10000000",usC type is unsigned short ,so the result should be "100000000" ,the 0x100. Please help tell me what is wrong? Thanks!!;) ... (2 Replies)
Discussion started by: micky.zhou
2 Replies

7. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

8. Shell Programming and Scripting

Unix commands delete all files starting with "X" except "X" itself. HELP!!!!?

im a new student in programming and im stuck on this question so please please HELP ME. thanks. the question is this: enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies

9. Solaris

significance of "+" char in SunOS "ls -l" output

Hi, I've noticed that the permissions output from "ls -l" under SunOS differs from Linux in that after the "rwxrwxrwx" field, there is an additional "+" character that may or may not be there. What is the significance of this character? Thanks, Suan (6 Replies)
Discussion started by: sayeo
6 Replies

10. Shell Programming and Scripting

awk "Invalid char ' in expession" error

I have an HP PPM (ITG) application that is running an awk command in cygwin bash shell as part of ITG process moving SAP transports on a Windows 2003 server. The awk command checks the first two characters of a file containing return code that was retrieved from the SAP server. It is throwing the... (3 Replies)
Discussion started by: accsam1
3 Replies

Featured Tech Videos