Manipulation of text by programs, scripts, etc.

learn more… | top users | synonyms

0
votes
4answers
593 views

How to get data count between two strings with multiple occurences in the same file

I have the data in my file as START-OF-FIELDS ID NAME DEPT END-OF-FIELDS START-OF-DATA 1|joy|cs 2|sam|ec END-OF-DATA START-OF-FIELDS ID NAME DOB DEPT ADDRESS END-OF-FIELDS START-OF-DATA ...
0
votes
3answers
548 views

compare two files based on a column and print it

I have two big files of 400,000 lines. I want to compare the column 1 of the second file with column 1 of first file recursively. If they match I would like to print the whole line. It is a sorted ...
1
vote
2answers
90 views

Split out data from a column

So at the moment I have some input email addresses and would like to separate the alias and the domain, then copy them to the end of the line. For example, from a line that has ...
0
votes
2answers
207 views

Formatting quotes from the fortune to use it with conky

I'm using fortune cookie outputs in my conky script. My fortune output is in the following format: Text1 : Some message including( line break tags, e.g. and comma(,),=,semicolon(;) like ...
1
vote
1answer
75 views

Fastest way of find and replace in large file with replacing filed present in another file

I have two files. File1 is a csv with 60 fields: 111,Check1|^/h1/h2/h3,22062014184500,20,0..... 111,Check2|^/h43/h40/h9,22062014184500,4,..... 111,Check3|^/h1/h3/h4,22062014184500,0,0,..... File2 ...
1
vote
1answer
105 views

Insert a line after a block of text with sed

I have text file: file.conf ### Option: LogFile # Name of log file. # If not set, syslog is used. # # Mandatory: no # Default: # LogFile= ### Option: LogFileSize # Maximum size of ...
0
votes
1answer
42 views

Remove given parts of a string with sed?

$ echo '<a href="mailto:NA?Subject=AB42525216 - FOOBAR bla bla - bla">NA</a>' <a href="mailto:NA?Subject=AB42525216 - FOOBAR bla bla - bla">NA</a> $ echo '<a ...
0
votes
1answer
28 views

Python: Move lines backward in a textfile

Imagine a text file which contains random text and two unique markers 01 text text text 02 text text text 03 __DELETE_THIS_FIRST__ 04 text text text 05 text text text 06 text text text 07 text text ...
0
votes
1answer
254 views

How to print gmail inbox messages

I want to print inbox messages one by one (like cat someFile) so that I can parse the message contents. something like printGmail InboxMesg1 | grep some | sed some Using curl I can access the ...
2
votes
0answers
38 views

Shell scripts for the database logs

The actual log file will be like this $ cat file1.log time=2014-07-23 23:56:28 GMT, user=[unknown], db=[unknown], host= pid=28254 LOG: time=2014-07-23 23:56:28 GMT, user=portalman, db=ss, ...
1
vote
0answers
67 views

How to create CSV file without unnecessary spaces

I use the xls2csv binary in order to translate XLS doc to CSV in my linux red-hat machine, example: ( from man page ) xls2csv -x "1252spreadsheet.xls" -b WINDOWS-1252 -c "ut8csvfile.csv" -a UTF-8 ...
0
votes
0answers
95 views

Editing metadata with bash

I have a bunch of photos(jpeg, bmp, png) that I have arranged in such a manner that the metadata is in html form in a separate file. I would like create some script to read this html file and edit ...
0
votes
0answers
86 views

sybase and iconv

I inherited an old Ubuntu 6.10 server running php 5.1.6 which is using sybase to connect to MSSQL. A user submitted some text containing an en-dash and crashed one of my script. It turns out sybase ...
-3
votes
0answers
24 views

Parsing the log file test into tabular format

How to display below test file in tabular format as below: Output should be like: ma1-test1.cor.dns.com cmd - ...