Sponsored Content
Top Forums Shell Programming and Scripting delete " from plain text files Post 302348535 by TheMrOrange on Friday 28th of August 2009 02:17:31 PM
Old 08-28-2009
delete " from plain text files

Hi,
sorry for bothering with this easy problem but I can't understand...

I've a file like this:
Code:
"4","0x23a3"
"5","0x4234"
"11",""
"20",""
"11132","0x6456"

I would like to create a file like this:
Code:
4,23a3
5,4234
11,999999
20,999999
11132,6456

I've tried:
Code:
cat INPUT.txt | sed -e 's/0x//' -e 's/""/999999/' -e 's/"//' >> OUTPUT.txt

but I've obtained this:
Code:
4","23a3"
5","4234"
11",999999
20",999999
11132","6456"

there are two problems:
why
Code:
-e 's/"//'

can not delete all
Code:
"

?
why script create an empty line at the end of the OUTPUT.txt file ?

Thank a million
 

10 More Discussions You Might Find Interesting

1. AIX

email from root sent my passord in plain text.

Root emailed me this message and thats ok it is supposed to. The thing that concerns me is that the ADMIN password came in plain text. I Xed it out for the purpose of this message of course. Is there a way for me to set this so the password comes encrypted? OR is not included at all in the... (4 Replies)
Discussion started by: rocker40
4 Replies

2. Linux

Plain Text printing issues

I'm attempting to print to a networked konica printer. No linux drivers that I know of exist, but we've always used HP 5si drivers and have had good results. We just loaded a box up with CentOS 5, and now when we print any sort of file from the command line (lp -dkonica <filename>), the text is... (0 Replies)
Discussion started by: fender177
0 Replies

3. Shell Programming and Scripting

Sed: Delete lines in files that contain other than a-z ,0-9 and "."

Sed: Delete lines in files that contain other than 'a-z' ,'0-9', '.' and '-' Hello, I'm looking for a shell command or maybe a small php loop to delete lines in files.txt (in the same directory) that contain character other then 'a-z' ,'0-9', '.' and '-' All line that have characters like... (4 Replies)
Discussion started by: devlin
4 Replies

4. 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

5. Shell Programming and Scripting

Script for delete tmp files older than 15 days and owned by "xxx" id

Hi All , I want to delete files from /tmp directory created by "xxxx" id. because i got the list says more than 60 thousand files were created by "xxxx" id since 2002. The /tmp directory has lot of files created by different user ids like root,system etc.. But, i need a script to... (2 Replies)
Discussion started by: vparunkumar
2 Replies

6. 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

7. Shell Programming and Scripting

from one word for line to plain text

Hello! I've got a very big file (from tokenization) which has one word for line. How is it possible then to rebuild the "original" text, knowing that <s> and </s> are the sentence-delimiters? My file looks like this: <s> && tanzania na Afrika kwa ujumla ambiwa na taifa kubwa... (6 Replies)
Discussion started by: mjomba
6 Replies

8. Homework & Coursework Questions

how to change this looking for mimetype "text/plain" instead of extension *.txt?

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Create a Shell script that looks for all text files in your home directory (including subdirectories). List... (3 Replies)
Discussion started by: rollinator
3 Replies

9. Shell Programming and Scripting

Modify one line in a plain text file

Hi everyone, I want to know, if there is a way to modify one line in a text file with unix script, with out re-writing all the file. For example, i have this file: CONFIGURATION_1=XXXX CONFIGURATION_2=YYYY CONFIGURATION_3=ZZZZ supose i have a command or function "modify" that... (7 Replies)
Discussion started by: Xedrox
7 Replies

10. 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
term::ansi::code(n)						 Terminal control					       term::ansi::code(n)

__________________________________________________________________________________________________________________________________________________

NAME
term::ansi::code - Helper for control sequences SYNOPSIS
package require Tcl 8.4 package require term::ansi::code ?0.1? ::term::ansi::code::esc str ::term::ansi::code::escb str ::term::ansi::code::define name escape code ::term::ansi::code::const name code _________________________________________________________________ DESCRIPTION
This package provides commands enabling the definition of control sequences in an easy manner. ::term::ansi::code::esc str This command returns the argument string, prefixed with the ANSI escape character, "33." ::term::ansi::code::escb str This command returns the argument string, prefixed with a common ANSI escape sequence, "33[". ::term::ansi::code::define name escape code This command defines a procedure name which returns the control sequence code, beginning with the specified escape sequence, either esc, or escb. ::term::ansi::code::const name code This command defines a procedure name which returns the control sequence code. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category term of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
control, declare, define, terminal CATEGORY
Terminal control COPYRIGHT
Copyright (c) 2006 Andreas Kupries <andreas_kupries@users.sourceforge.net> term 0.1 term::ansi::code(n)
All times are GMT -4. The time now is 01:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy