Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: firefox2k2
1,148
Posted By firefox2k2
Bash copy and paste text in file from one position to another
Hi I have a text file with lines beginning with 71303, 71403, 71602,

I need to copy the 10 digit text at position 30 on lines beginning with 71303 (5500011446) to position 99 on every line...
2,195
Posted By firefox2k2
Hi Robin, below is an example of the original...
Hi Robin, below is an example of the original text file I am starting with, the numbers are an order quantity, they can be anything from 0 to 100's:

DTM+64:20160601:102'
DTM+63:20160630:102'...
2,195
Posted By firefox2k2
Hi that works great, how do I include this line...
Hi that works great, how do I include this line in the small script below so it makes the changes?

I am very new to this

for file in *.TEST
do
sed -i 's/DTM+/DTM07 /' $file
done


Thank...
2,195
Posted By firefox2k2
Bash detecting number of digits in line
Hi I have a problem, I am attempting to write a bash script that goes through a file and can determine how many characters are at a set point in a line starting with QTY+113:100:PCE, If it detects 3...
1,271
Posted By firefox2k2
Nearly there I think, slight problem, instead of...
Nearly there I think, slight problem, instead of count up its going 1 - 21, 3 - 41, 5 - 61

Also the second set of numbers 21,41,61 are at position 87 instead of 88, see below, thanks again for...
1,271
Posted By firefox2k2
Hi that's kind of working problem is when it gets...
Hi that's kind of working problem is when it gets into double digits it's moving everything after up a place, like its inserting an extra character rather than copying over. I have highlighted the...
1,271
Posted By firefox2k2
Hi Jotne, There are other lines of data so...
Hi Jotne,

There are other lines of data so this way won't work, unless there's a way to keep those lines in?

Thank you for the help, it is much appreciated
1,271
Posted By firefox2k2
Bash script to count and insert
Hi not sure if this is possible but I need some help with a bash script, I have a text file and on the first line that starts with 7150230 I need it to put a 1 at position 79 and a 2 at position 88,...
5,883
Posted By firefox2k2
hi thanks for the reply, I need to find all...
hi thanks for the reply,

I need to find all files with the extension .order, so I tried the following:

#!/bin/bash
filename="*.order"
if [[ -e $filename ]]
then
echo "yes its there"
else...
5,883
Posted By firefox2k2
sed if statement to see if file exists
Is there an easy way of checking for the existence of a file that ends with the extension .order and if it exists do something? if not do nothing
700
Posted By firefox2k2
Ok will give it a go and let you know. ...
Ok will give it a go and let you know.

Appreciate the help.

---------- Post updated at 05:39 AM ---------- Previous update was at 04:44 AM ----------

Thanks RudiC that helped me a lot!
...
700
Posted By firefox2k2
Thanks for the reply, New to this so never...
Thanks for the reply,

New to this so never thought of it like that but makes sense, is there anyway to insert at position 28 and overwrite hence not adding an extra character?
700
Posted By firefox2k2
sed pattern matching help required
Hi I am trying to pattern match with sed, if it finds a match I need it to insert characters at the 28th position, its working but its also adding an extra space and I don't know why, below is the...
936
Posted By firefox2k2
Hi thanks for the help, tried this but get a...
Hi thanks for the help, tried this but get a syntax error when running
936
Posted By firefox2k2
help extracting text from file
Hello I have a large file with lines beginning with 552, 553, 554, below is a small sample, I need to extract the data you can see below highlighted in bold from this file on the same location on...
910
Posted By firefox2k2
bash if statement help needed
Hi I need a script with an if statement that goes.

I need it to search through all files within a directory with the extension .test if it finds the string '71502FSC1206' then do
sed...
2,536
Posted By firefox2k2
Thank you Jim! worked a treat! much appreciated...
Thank you Jim! worked a treat! much appreciated :b:
2,536
Posted By firefox2k2
combining multiple sed statements
I need to run a cronjob that will monitor a directory for files with a certain extension, when one appears I then need to run the below scripts How do I go about combining the following sed...
877
Posted By firefox2k2
Many thanks everyone! really really appreciate...
Many thanks everyone! really really appreciate the help, all working now :b:
877
Posted By firefox2k2
Thanks for the reply but that did not work, I...
Thanks for the reply but that did not work, I need it to place a Letter F at the 127th position on every line it finds that starts with 71502FSC1206 :b:
877
Posted By firefox2k2
Pattern matching problem
Hi I need a bash script that can search through a text file for all lines starting with 71502FSC1206 on every line it finds starting with this I need to place a letter F at the 127 position on that...
952
Posted By firefox2k2
sorry for not explaining better, there are...
sorry for not explaining better, there are multiple instances FSS1206.

Would it be easier searching for 71502FSS1206 FSS1206 and place a letter F 100 spaces after...
1,752
Posted By firefox2k2
bash script search file and insert character when match found
Hi I need a bash script that can search through a text file and when it finds 'FSS1206' I need to put a Letter F 100 spaces after the second instance of FSS1206

The format is the same throughout...
952
Posted By firefox2k2
Pattern matching and format problem
Hi I need a bash script that can search through a text file and when it finds 'FSS1206' I need to put a Letter F 100 spaces after the second instance of FSS1206

The format is the same throughout...
2,990
Posted By firefox2k2
Hi ahamed, I am using Ubuntu server.
Hi ahamed,

I am using Ubuntu server.
Showing results 1 to 25 of 27

 

Featured Tech Videos

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