Manipulation of text by programs, scripts, etc.

learn more… | top users | synonyms

2
votes
1answer
49 views

Text editor that allows for coloring of arbitrary text (and exporting thereof)?

I have a rather large backtrace, which is kind of difficult to read, so I thought I'd color the portions of the backtrace text for easier reading. (I thought, as a backtrace problem, this question is ...
2
votes
1answer
97 views

Modify filenames in Makefile

For reasons that are not important here, I have a source code that I process automatically file-by-file and the processed source files are renamed in a systematic manner. For example, I start out with ...
1
vote
1answer
38 views

How to set csplit output filenames by pattern?

Is there a way to set output names of csplit through the pattern? I want to split the ssh-config by hosts to corresponding files. If there is a solution without csplit I'm happy as well.
1
vote
1answer
39 views

How to Load data to one table from Multiple excel files?

I have to load data from multiple excel file into one table , Please help me to achieve the solution. We are getting excel file from different retail shop which contain multiple column , each file is ...
1
vote
1answer
46 views

Shell script: Text files to array

I must use C-shell. I have a 40+ list of ip and hostname in text file. sat1 100.34.54.65 sat2 100.34.54.55 sat3 100.34.54.45 and so on.. i want to set the ip and hostname as list of array. The ...
1
vote
1answer
47 views

Random place change in row with restrictions

How could I randomly change places of characters in a text file, with some probability (say 10%)? file: 1 34567 2 12356 3 16987 outcome: 1 35674 2 12653 3 61987
1
vote
1answer
116 views

Need help removing words from list

I have been using crunch in Kali Linux to create a wordlist that is 10 characters long using the lalphanumeric (a-f 3-9 ) command. I know they're big files so please don't tell me not to do it. I've ...
1
vote
1answer
57 views

Find matches from an index file without exact matching and print the last field

I have a large file (~6mill rows) with 2 columns which looks like this: 1111.aaaaabbb.b.cccc.c ValueA 2222.dddddeee.e.ffff.f ValueB 3333.gggghhhh.h.iiii.i ValueC I want to use that as my index ...
1
vote
1answer
41 views

Form a output by combining multiple lines

I have a log file as below: /export/home/got/logs/o2877612.01:job_1432787863184_159408 Message: org.apache.pig.backend.executionengine.ExecException: ERROR 2118: Input path does not exist: ...
1
vote
1answer
220 views

Grepping multiple instances of a string, with context, from a file

I have a MySQL dump file, which is mostly INSERT statements. I want to grep out instances of the string 'media' from a field in a particular table, with +/- ~10 characters of context. The string might ...
1
vote
1answer
60 views

Specify the type of field to modify in a file

I have a list of clients, "code", "name", "location", "etc" and I want to make a function that asks the employee to give the client's code and then the field he/she wants to change. For example, ...
1
vote
1answer
109 views

Shell script runs diffrently based on working directory.

I have a script which runs differently based on current working directory. Basically it processes an .ini file and takes parameters from it and runs mysql backup. Script is running as root user. ...
1
vote
1answer
113 views

Using “ps -C java -o pid,user,cmd” Can I reduce the output of cmd?

I am trying to get this command down to just the essential information that I need. In the command cmd comes back with this output... /usr/local/jre1.7.0_51/bin/java -Dwd.tag=boxect ...
1
vote
1answer
205 views

How can I compare 2 files and add lines that aren't on the second file?

I have run into a problem while doing some coding, and I need to compare two files, here is an example input file inputfile1.txt: car php module so js node array and another input file: ...
1
vote
1answer
55 views

convert row into column based on particular key

I have file like Below. But header are in different line the header Values are printed in down to the hear. I want all the header in single row & value to the Particular header to be print to ...
1
vote
1answer
139 views

Process Files to create a new file

I have a file1 which contains comma separated values (timein/timeout in military time format eg 0800, 0900, 1300). For each line of File 1 contains timein/timeout for each day. Sample File 1: Name, ...
1
vote
1answer
63 views

Create files from templates, substitutions in middle of other words

Is there a way to convince m4 to replace a macro in the middle of a word? I would like this file, day.m4: define(Sat,Cat)dnl Saturday and this command: m4 day.m4 to produce this output: ...
1
vote
1answer
430 views

Fastest way to find and replace in large file while replacing field 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
285 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
33 views

Removing a pattern from a string and then storing the whole string into one index in an array

So I have a file of many fields which start with "Content:" like below... NOTE: The content goes over multiple lines Content:Wonderful time- even with the snow! What a great experience! From the ...
0
votes
1answer
28 views

How to implement config file expiration time?

I have a Debian server which runs a service using multiple config files (in a similar way to apache2) which I need to add an expiration date to. The config file that has an expiration date starts with ...
0
votes
1answer
34 views

extract the data from 2 files

I have two files, the first file contain only 1 field, the second file has more lines than first file and also it has different field in each line. File 1: 5 15 20 File 2: 3 5 O 1.25 2.30 3.75 ...
0
votes
1answer
56 views

Sed command for performance improvement or tr command for the same

I have a command to replace the non printable characters and single quotes from a file but its taking more time to execute as I am replacing these characters for multiple files and the files size is ...
0
votes
1answer
30 views

Print lines not containing a Tab

I have a text file (around 15000 lines) that is supposed to contain two fields separated by a Tab in each line. Is there a way to display the lines that do not contain a Tab separating the two ...
0
votes
1answer
40 views

Output number of words, characters, or lines in an .doc or .docx document from command line

I have a folder full of .doc or .docx files. I'd like to know how many words--or, failing that, characters or lines--are in each file without opening each one of them. (Use case: I'm a TA who needs to ...
2
votes
0answers
78 views

Converting a raw print data stream containing PCL commands to PDF

I have a program that sends raw print data through samba to typically PCL compatible printers. The program is written so basic PCL commands control how it prints. When sending it to the printer it ...
2
votes
0answers
356 views

Bash regular expression comparison fail for hex byte \x01

Bash regular expression fails to compare correctly for $'\x01' when End-Of-String char $ is used. All other byte values (seem to) compare correctly. Using GNU bash 4.1.5(1). Is this a bug, or is ...
2
votes
0answers
231 views

Bash - Convert escape character colored text to BBCode

I want to convert a terminal escape-character colored text file to BBCode colored text. For this i've created an Android logfile with logcat -Cd > /sdcard/logcat.txt. The -C switch adds the color ...
2
votes
0answers
69 views

Make GNU indent break long comments

Is there a way to convince GNU indent to break long comment and change it to multiline comment? Something like this: // Very long comment, longer than 80 characters. Just imagine that. To this: /* ...
2
votes
0answers
184 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
52 views

how to copy a piece of a text file byte-by-byte to another text file? dd, head, or?

I need to grab the first lines of a long text file for some bugfixing on a smaller file (a Python script does not digest the large text file as intended). However, for the bugfixing to make any sense, ...
1
vote
0answers
26 views

Scraping from applications other than browsers on Debian Jessie

I'm thinking of building an automated trading system. I think there's probably no services supplying informations of order book and top of book in the txt format. So I have to do scraping. I want to ...
1
vote
0answers
95 views

Convert / import flat file with multiple records, one variable per line

I am searching for an efficient way using (UNIX) command line tools to read a flat file into a(ny) database, perhaps after first converting to an intermediate structured format, for example XML or ...
0
votes
0answers
12 views

Linking and combining text from different documents into dynamic document

I am taking notes on many, related topics from multiple sources. For instance, one of the sources is a textbook on machine learning. I type the notes in an .odt document (but whatever, it could be ...
0
votes
0answers
34 views

Parse iostat and print selected stats

The below is my statistics: [gpadmin@GP-MASTER]$ iostat -t -c Linux 3.8.13-16.2.1.el6uek.x86_64 (GP-MASTER) 02/25/2016 _x86_64_ (1 CPU) 02/25/2016 10:44:59 AM avg-cpu: %user %nice ...
0
votes
0answers
21 views

Order Columns in CSV file

I am trying to order all columns by column name in a csv file. What I have is something like this: name ,adress ,mobile-number Ane ,USA ,12121212 Joane ,England ,234234 and the output I ...
0
votes
0answers
43 views

Create Paragraph Numbers in Roxterm

I have a text file created in Roxterm. I need to number the paragraphs. So, for instance, the first paragraph would be labeled 1 and so on. Is there a command to do this? My text file is called ...
0
votes
0answers
23 views

How to read fields of a text block?

I would like to create sql inserts based on Radius log fields. For example, I have these two types of accounting logs and I'd like to convert each text block to an insert like below: INSERT INTO ...
0
votes
0answers
26 views

Creating a mini text-editing program

I often copy-paste text from pdfs into other applications, and wish there was an easy offline way of editing the text's characteristics. For example, this website removes line breaks, while this ...
0
votes
0answers
47 views

Fetch data from a CSV file based on multiple conditions

I'm trying a write a generic shell script which should extract data from a CSV file based on multiple conditions (generic) and write it to another CSV file. Sample CSV file: ...
0
votes
0answers
111 views

Unable to match multiple ip addresses using grep

I am trying to match multiple ip addresses, 100.x..x.x and 13.19.x.x here is my syntax. for item in `cat s3` do egrep -o '100\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} | ...
0
votes
0answers
24 views

In sed, what's the best way to apply blocks of commands to multiple addresses?

If I have a block of sed commands I want to apply to multiple addresses that aren't an address range, what is the best way to do this without repeating the block separately for each address? The only ...
0
votes
0answers
27 views

Creating wordlists

I was creating wordlist using crunch. I successfully created the wordlist. However I need to create another wordlist after the word pass111 so that the passwords are like this Pass112 Pass113 Pass114 ...
0
votes
0answers
31 views

Excel - Keep data on field that starts with

I have an excel file with the following data example 1 E Eastland Care Ctr pbrotherton@voa.org 2425 Kimberly Pkwy E Columbus OH 43232-4271 2072822617 6148689306 805101 Nursing & ...
0
votes
0answers
78 views

Drawing a histogram from a bash command output

I have the following output from a miRNA Predictor: Read Sequence:hsa-miR-576-3p MIMAT0004796 (22 nt) Read Sequence:gi|182396|gb|M74088.1|HUMFAPAPC Human APC gene mRNA, complete cds (8972 nt) ...
0
votes
0answers
30 views

Output a particular character if the same column consists of a few defined characters with AWK

Let say I have a text file as below: G W G A A T G A A T R A T A R A G - G A And I already know that if the same column consist of "A", "G" and "T", I would like to output a "D". For column 2, ...
0
votes
0answers
42 views

Searching text data in Hebrew, Arabic or Aramaic

How can I search for a (sub-)string in a database that has several languages, including Hebrew? I am assuming that the text being right-to-left is a question of the presentation, but the logical ...
0
votes
0answers
78 views

Compare specific word counts without variables or expr

For a homework assignment, I am tasked to write a bash command to count the number of specific words (given in a file) in two files and write an error message if the number of these words in the first ...
0
votes
0answers
335 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
137 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 ...