Search Results

Search: Posts Made By: jl487
780
Posted By bartus11
Have you tried not escaping at all?sed...
Have you tried not escaping at all?sed 's/$(variable #)/HERE/' input
4,930
Posted By Yoda
That was just an example. Use bash instead,...
That was just an example. Use bash instead, replace print with printf:
#!/bin/bash

while :
do
printf "%s" "A1: "
read A1
[ ${#A1} -le 8 ] && break
done
3,000
Posted By Corona688
This should easily let you input an exact string...
This should easily let you input an exact string to take as the string to reject.

$ cat regafter2.awk

# Recall N lines ago up to 9 lines
function last(N)
{
if(N>L) return("");
...
1,836
Posted By vgersh99
sed -n '/Example Hello/,/Example/s/Text.*/&/p'...
sed -n '/Example Hello/,/Example/s/Text.*/&/p' myFile
12,265
Posted By bartus11
Something like this?awk...
Something like this?awk '/<Name>/{$1=$1;n=$0}/<EditField>/{$1=$1;e=$0}/<Title>/{$1=$1;t=$0}/<\/Column>/{print e?n","t","e:n","t;e=""}' file
12,265
Posted By bartus11
Try: awk...
Try: awk '/<Name>/{$1=$1;n=$0}/<EditField>/{$1=$1;e=$0}/<\/Column>/{print e?n","e:n;e=""}' file

---------- Post updated at 09:22 AM ---------- Previous update was at 09:20 AM ----------


This...
9,487
Posted By sulti
| cut -b-9 No need for delimiters if Youre...
| cut -b-9
No need for delimiters if Youre writing bytes (chars).
5,026
Posted By agama
Because your quotes are in the wrong place. Try...
Because your quotes are in the wrong place. Try this:



var="`echo test.txt | cut -d . -f1`"


Or the preferred way (no backticks)

var=$(echo test.txt |cut -d . -f 1)
14,829
Posted By agama
You're on the right track. The redirection to...
You're on the right track. The redirection to $word.txt needs to happen inside of the loop. Yes, you can redirect the output of the loop to a file, but that output file is opened once by the shell...
1,131
Posted By bartus11
didn't read carefully, sorry ;)
didn't read carefully, sorry ;)
1,131
Posted By agama
Assuming that XXXXKV is always preceded with a...
Assuming that XXXXKV is always preceded with a space this should work:


sed 's/ [^ ]*KV.*//' input-file >output-file


From your original post you want the 230 from 230KV to be removed too. If...
2,804
Posted By vgersh99
you have a wrapped line AND you don't need...
you have a wrapped line AND you don't need '#!/bin/bash':

BEGIN {
dirN=split("right left", dirA, FS)
}
/margin-/ {
for(i=1;i<=dirN;i++)
if (match($0,"margin-" dirA[i]...
2,804
Posted By vgersh99
have you tried the code I've posted?
have you tried the code I've posted?
1,671
Posted By rdcwayx
sed...
sed 's/.*ID="\([^"]*\)".*NAME="\([^"]*\)".*AGE="\([^"]*\)".*/\1 \2 \3/' infile |grep -v "<\/Identifier>"
27,902
Posted By pseudocoder
This code actually stores the source text of a...
This code actually stores the source text of a webpage and will work pretty nice in this case:
#!/usr/local/bin/python

import urllib
import os

# get data
f =...
Showing results 1 to 15 of 15

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