Search Results

Search: Posts Made By: martinsmith
1,494
Posted By martinsmith
Hi Peasant, Thank you so much for saving my...
Hi Peasant,

Thank you so much for saving my day. Your code worked perfectly!

Much appreciated. many thanks again! :D
1,494
Posted By martinsmith
Insert the line number from text file to filename output
Hi everyone :)

I have a file "words.txt" containing hundreds of lines of text. Each line contains a slogan.

Using the code below i am able to generate an image with the slogan text from each...
1,212
Posted By martinsmith
Thank you Scrutinizer! All of your solutions...
Thank you Scrutinizer!

All of your solutions worked perfectly and solved the problem.

Many Thanks for your help! It is so much appreciated :b:
1,212
Posted By martinsmith
Hi Robin, Thank you! It's not a...
Hi Robin,

Thank you!

It's not a homework assignment. I'm just trying to clean up some data which i had extracted.

Basically i tried some commands with sed and awk but could not figure this...
1,212
Posted By martinsmith
Remove matching pattern on each line with number variations
Hello folks!

I have a file containing lines like this

Something text 18:37Remove This: 1,111"Keep this text"
Some more text 19:37Remove This: 222"Keep this text"
More text 20:50Remove This:...
2,044
Posted By martinsmith
That's the result i needed. ( with capitalization...
That's the result i needed. ( with capitalization only performed between an occurrence of the first string up to the next occurrence ) Thank you Don!.
The perl solution from Aia solved the issue.
...
2,044
Posted By martinsmith
Hi Don, Yes it will, and also where...
Hi Don,

Yes it will, and also where sometimes PATTERN2 appears before title=">PATTERN1

Example:
PATTERN2 whatever whatever ..... title=">PATTERN1 tokyo city PATTERN2 whatever whatever...
2,044
Posted By martinsmith
Thank you Aia and R.Singh. Both solutions...
Thank you Aia and R.Singh.

Both solutions work great but i ran into a small issue. It seems to replace only the first occurrence and ignores the others.

I tried the following sample code with...
2,044
Posted By martinsmith
Hi Aia, It works perfectly as i was hoping for!...
Hi Aia, It works perfectly as i was hoping for! Thank you very much for this solution. :)
2,044
Posted By martinsmith
Convert text between exact matching patterns to Title case
Hi Folks,

I have a large text file with multiple similar patterns on each line like:
blank">PATTERN1 some word PATTERN2
title=">PATTERN1 some word PATTERN2
blank">PATTERN1 another word PATTERN2...
7,525
Posted By martinsmith
Thank you everyone! Lot's of awesome solutions...
Thank you everyone! Lot's of awesome solutions for this problem. Very much appreciated!
7,525
Posted By martinsmith
The string length was between 3 to 12 characters....
The string length was between 3 to 12 characters. ( words which were identical ).

I tried your solution and it works like a charm. Thank you Rudi :b:

---------- Post updated at 07:58 PM...
7,525
Posted By martinsmith
Remove lines containing 2 or more duplicate strings
Within my text file i have several thousand lines of text with some lines containing duplicate strings/words. I would like to entirely remove those lines which contain the duplicate strings.

Eg;
...
20,923
Posted By martinsmith
Thank you Don and R. Singh. The commands work...
Thank you Don and R. Singh. The commands work perfectly as i was hoping to solve my problem. Thanks for the blank lines solution as well. Cheers
20,923
Posted By martinsmith
:b: Thank you R. Singh. It works perfectly as i...
:b: Thank you R. Singh. It works perfectly as i needed. Cheers
20,923
Posted By martinsmith
How to add a character after the first word/space on each line?
Hi:)

I have a large file ( couple thousand lines ) and I'm trying to add a character after the first word/space on each line.
eg:

First line of text
Second line of text
Third line of text...
3,772
Posted By martinsmith
[QUOTE=Aia;302964465]Please, try: perl -pe...
[QUOTE=Aia;302964465]Please, try:
perl -pe 's:(folder\d+)/\1:$1/:g' martinsmith.file
This too worked just as well. Thank you Aia :b:
3,772
Posted By martinsmith
Hi R. Singh, Yes the 2nd one worked...
Hi R. Singh,

Yes the 2nd one worked perfectly. I overlooked it!
awk '{for(i=2;i<=NF;i++){split($i, A,"/");if(A[1]==A[2]){Q=Q?Q OFS A[1] "/":A[1] "/"} else {Q=Q?Q OFS $i:$i};}print $1 OFS Q;Q=""}'...
3,772
Posted By martinsmith
Hi R. Singh, Thanks very much. Your solution...
Hi R. Singh,

Thanks very much. Your solution does work. Unfortunately i did not describe my issue more clearly so it did not work for my problem. I have updated the question with more...
3,772
Posted By martinsmith
Remove duplicate occurrences of text pattern
Hi folks!

I have a file which contains a 1000 lines. On each line i have multiple occurrences ( 26 to be exact ) of pattern folder#/folder#.

# is depicting the line number in the file

...
3,446
Posted By martinsmith
Wow totally awesome! It does exactly what i...
Wow totally awesome! It does exactly what i needed.

Thanks so much for your help. Appreciated tremendously! :)
3,446
Posted By martinsmith
Randomized shuffle words on each line
Hi Folks,

I have a text file with a thousand lines consisting of words or a group of words separated by commas.

I would like to randomize / shuffle the words on each line.

Eg; file.txt...
4,137
Posted By martinsmith
Thank you Don! It works perfectly. Just what I...
Thank you Don! It works perfectly. Just what I needed. Many Thanks
4,137
Posted By martinsmith
Sort words based on word count on each line
Hi Folks :)

I have a .txt file with thousands of words. I'm trying to sort the lines in order based on number of words per line.

Example

from:

word
word word word
word word
word word...
25,108
Posted By martinsmith
Thanks very much Scrutinizer! Appreciate that you...
Thanks very much Scrutinizer! Appreciate that you explained the tags as well. I'm a total newbie to this stuff :) Cheers
Showing results 1 to 25 of 31

 
All times are GMT -4. The time now is 06:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy