text-processing's questions - English 1answer

4.933 text-processing questions.

I need to replace all spaces which exist within quotes. I have several columns yet only one column has quoted output containing spaces which is throwing off my columns when using column -t "UDP ...

I've been looking around sed command to add text into a file in a specific line. This works adding text after line 1: sed '1 a\ But I want to add it before line 1. It would be: sed '0 a\ but I get ...

CLASS RECORD OF THE STUDENT FROM THE PREVIOUS BATCH WHO TOPPED Name (Roll no) # Location Section Rank (MARKS) Gender Anna (+) USA A1 First (100) Female (...

I have a poem with an unknown number of rows and I want to display only the penultimate one. What command should I use?

I have a text file which has following content DESCRIPTION ENABLED Tracker_EG32747257_0418_0618, {NAME => d, DATA_BLOCK_ENCODING => NONE, BLOOMFILTER => ROW, REPLICATION_SCOPE => 0, ...

Hello i want make a script to comment at specific moment #a6712376789 aeaasdfsdgf asdffdgjf anfth #v1781289123 #8765123ha71 kldfgnkajfb xcmbvnkzv zxjvb #9054123h273 #a64464v79870 poiyghjf okjfcjnh ...

Currently working on some RegExp to parse an input file for correct content. I'm using the below RegExp to parse some input: cell-(90|855|80|70)-(DEV|DEVL|SANDP|CAT|(SIT[a-z]|SIT[1-9])|TAT|PROD)(?:-(...

I have two fields in logs sending time and received time mentioned in milliseconds, I have to find difference between these two fields, if it's greater than 2 seconds print those logs using shell ...

I have a file with data like this vserver-1 vserver-1_root 0.95 0.0019043 0.948047 vserver-1 home 10.00 8.25 1.75 vserver-1 usr 95 45.65 39.35 vserver-1 file0 100 89.15 10.85 Desired formatted ...

This is the content of a text file, and I want to only keep BMP. 这是无效的字符 𡛂 这是正常的字符 哈 In the How to remove non UTF-8 characters from text file , I find there is a solution, but it doesn't work ...

sed's capture grouping ALTERNATION is not working as expected. While alternation has the lowest precedence, here is the confusion: echo "abcd_aefghi" | sed -r "s/(a)(b)(c)(d)|(a)(e)(f)(g)/\8/g;" ...

I want to decode URL encoding, is there any built-in tool for doing this or could anyone provide me with a sed code that will do this? I did search a bit through unix.stackexchange.com and on the ...

How can I format netstat output so I have a list of TCP connections made to the server? A bit like this: 192.168.234.1 51780 192.168.234.221 51444 192.168.234.251 51447 The closest I got was six ...

I want to insert a new line in two lines before the last line. So if my original file is: 1 2 3 4 5 The result should be 1 2 3 New line 4 5

I have this file as input: root 1243 0.0 0.0 65508 6036 ? Ss Apr30 0:05 /usr/sbin/sshd -D root 7385 0.0 0.1 152932 10644 ? Ss 16:22 0:00 sshd: per1 [priv] per2 ...

Using version control systems I get annoyed at the noise when the diff says No newline at end of file. So I was wondering: How to add a newline at the end of a file to get rid of those messages?

I have bad csv files, and need to add some quotes In field,field2,text field with potential commas,field4,field5 field,field2,text fie,ld with pot,ential commas,field4,field5 field,field2,text field ...

I have got a file that has 24-jan-2017 for example. I want to increment the given date by 1 year and print. Any clue how to do that via cli? OS: FreeBSD

I have heard that printf is better than echo. I can recall only one instance from my experience where I had to use printf because echo didn't work for feeding some text into some program on RHEL 5.8 ...

I have a variable called DISK_INFO with the following contents: diskid HGST HUSMH8010BSS204 serial no no [0] Slot00 diskid HGST HUH728080AL4204 serial no no [...

In a text processing field is there a way to know if a tab is 8 characters in length (the default length) or less? For example, if I have a sample file with tab delimiter and the content of a field ...

I have two files: one which is the dictionary, and the other one corresponds to the list of words that appear in a transcription. I need to output the words out of vocabulary words. This is: dict.txt ...

I have a huge file with about 12300 lines that look something similar to this. 001.domain.com=001.somedomain.com:10001 002.domain.com=002.somedomain.com:10002 003.domain.com=003.somedomain.com:10003 ...

I just encountered with a question. It is very similar to what I already asked before how to copy a column from another file when the ID's matches, with some differences. I have a folder (folder1)...

I thought I knew my way around a for loop using sed, I guess not! I wrote a small script that will recursively go through all *.py files within a directory and replace specific entries in the files. ...

I am trying to filter out record which is having "invalid character"(like control-m ^M characters or simply not valid characters). Example: 12345 vimal 1235566 ^zfood nation Here, the ^z, which in ...

I have a CSV file with 150+ columns, with the new line character as a record separator. The problem lies in one of the columns getting new line characters. For this, I want to remove those. Input: ...

I need to periodically run a command that ensures that some text files are kept in Linux mode. Unfortunately dos2unix always modifies the file, which would mess file's and folder's timestamps and ...

I want to search for characters in file and replace with file containing contents: search for ktr_updater in file and replace with file contents from another file using Unix commands. sed -i 's/...

I'm looking for an awk solution to get from this table (with x number of names in column 1, and different lengths of column 2 which is ";" separated): dataframe.txt: name1 1;2;4;8 name2 4;5;7 name3 ...

Awk Gurus, Need a small help here, please My input file is: puloto_cluster_b_02_sys puloto_cluster_b_02_sys puloto_cluster_b_generic_cg puloto_cluster_b_02_temp ...

I am using unix on AIX. I want to know if there is a way in which I can replicate rows of data either within an existing file or reading from file a and results into file b, or within a temp table by ...

I have a document I'm formatting, it contains 1/2 million lines of text and are basically identical to the example below. I need to delete the the tab in between the two letters, so that this: ...

I am in the habit of writing one line per sentence because I typically compile things to LaTex, or am writing in some other format where line breaks get ignored. I use a blank line to indicate the ...

I have the below file1.txt. What I want to do is to take the value1 until value7 and output it in one row. The value will be scanned between the word "Start" and "End". In case the label/value is ...

Related tags

Hot questions

Language

Popular Tags