Manipulation of text by programs, scripts, etc.

learn more… | top users | synonyms

2
votes
1answer
87 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
23 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
44 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
44 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
61 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
45 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
39 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
58 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
103 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
102 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
182 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
53 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
128 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
397 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
261 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
22 views

Convert a column of epochs into a time column starting from 0

What I have Hi, imagine a lot of this files, where first column is epoch, and the other(s) column(s) are some data: 1000333,34,1 1001456,56,0 1005356,34,2 What I need I need to transform them ...
0
votes
1answer
30 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 ...
0
votes
1answer
31 views

Make new line above last line and add something there

Like a reverse of awk 'NR==2 {print ""} 1 which adds a new line under the first and prints whatever there. I can't replace the number after NR== with a fixed value because I want to be able to do this ...
0
votes
1answer
24 views

How can I get just the enum names from a Java file?

Enum files in java can get messy in structure, I'm trying to get Just the Enum names ... import com.mckesson.dex.model.activityLog.concreteFactory.ModifiedPropertyYesNoFactory; public enum ...
0
votes
1answer
31 views

Print specific FULL column only by range

I have a file which have contents like this. Column1 Column2 Column3 Column4 USER1 25 Years xyz zyz 123 abc ...
0
votes
1answer
87 views

Delete customers domain extension only (in .csv file)

I have a list of my customers emails and want to remove some that end in .br for example. I would normally do the following command: sed -i '/.br/d' customers.csv But that would also delete a ...
0
votes
1answer
73 views

How can I regex specific links from rss content in yahoo pipes?

From a RSS content I'd like to remove everything except specified href links Example: <div class='text'> <div class="center"> <b><a rel="nofollow" target="_blank" ...
0
votes
1answer
135 views

Search a file for a string in multiple directories

Can someone please help me with a command to search a file for a string in multiple directories? I am searching for the VIP in httpd.conf in multiple httpd instances. I am using: find ./ -name ...
0
votes
1answer
543 views

How to get `pdftotext` to output text in a readable encoding?

I converted a PDF file into a txt file using pdftotext. As an example, i have the sentence "This is the first study on the functional relevance of", notice the f in "first", when i process this sentence ...
2
votes
0answers
43 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
0answers
69 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
322 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
197 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
63 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
161 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
25 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
86 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 ...
1
vote
0answers
164 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
0answers
111 views

Sed regex printing into a file.txt

I'm connected to a MQTT stream, and I filter out the data by entering : mosquitto_sub -d -t +/# 2>&1 | sed -n "/PUBLISH/{s|.*\('.*',\).*|\1$(date),|;N;s/\n//;p}" into the Ubuntu terminal. ...
0
votes
0answers
19 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
13 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
34 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
34 views

copying a set of lines into new file

I have a text file with 100,000 lines or more. I want to copy specific lines from the text file into a new file using: sed -n '1,1000p;1000q' orig-data-file > new-file However, I want to create ...
0
votes
0answers
78 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
22 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
26 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
67 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
28 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
35 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
67 views

Compare specific word counts without variables or expr

I am tasked to write bash command to count number of specific words (given in file) in 2 files and write an error message if number of these words in first file is more than 3 times biggen than in the ...
0
votes
0answers
299 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
135 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 ...