Hi all,
I've searched the web and this forum for this but not had any luck. I'm trying to use sed so when it finds a space it will insert a new line.
What i have is a file containing .e.g
1 2 4 7 9
and want it to look like
1
2
4
7
9
I've tried:
more test2 | sed 's/ /\\n/g'... (1 Reply)
For lists in sed, to say what to replace, is this correct:
I am hoping that this would recognise that either a "." is present, or that the substitution happens at the end of the line.
For files with extensions , my script works perfectly.
My problem is, files without extentions, i.e. . ... (1 Reply)
Hi,
I want to use the sed command to delete some lines in a file and I was wondering whether there is a possibility of knowing which lines are deleted, or at least which line numbers.
Thanks (4 Replies)
I have a somewhat bizarre problem when trying to concatenate lines in a file.
Using cat file.txt | sed -e :a -e '/$/N;s/\n/ /;ta' the output in file.txt should go from
1
2
3to 1 2 3 instead I only get the last line or 3.
I find that if I open the file in gedit and hit delete in front of every... (7 Replies)
Hi,
After looking on different forums, I'm still in trouble to parse a parameters line received in KSH.
$* is equal to "/AAA:111 /BBB:222 /CCC:333 /DDD:444"
I would like to parse it and be able to access anyone from his name in my KSH after.
like
echo myArray => display 111
... (1 Reply)
So, I want to read line-by-line a text file with unknown number of files....
So:
a=1
b=1
while ; do
b=`sed -n '$ap' test`
a=`expr $a + 1`
$here do something with b etc
done
the problem is that sed does not seem to recognise the $a, even when trying
sed -n ' $a p'
So, I cannot read... (3 Replies)
If I have this:
perl -pne 's/img_onload.{8}//g'
How would I do to instead of replacing img_onload.{8} with "nothing", get "nothing" to be a deleted line? Kind of the opposite to \n. (2 Replies)
I was using the following option to clean up the ^M characters in a file that was FTPed from Windows:
- dos2unix
- sed 's/^M//g'
The ^M characters are removed but the last line is also getting removed. Any idea why this is happening.
Satish (2 Replies)
Hi guys, I am currently using this to save first 50 lines into top50.txt and delete them from list.txt ... it's 2 commands:
head -n 50 list.txt > top50.txt && sed -i "1,50 d" list.txt
I want to change that so it's 1 command - whereby sed removes the first 50 lines as above but that which is... (3 Replies)
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies
LEARN ABOUT DEBIAN
weather::com::forecast
Weather::Com::Forecast(3pm) User Contributed Perl Documentation Weather::Com::Forecast(3pm)NAME
Weather::Com::Forecast - class representing all available weather forecasts for one location
SYNOPSIS
[...]
my @locations = $weather_finder->find('Heidelberg');
my $forecast = $locations[0]->forecast();
my $tomorrow = $forecast->day(1);
print "Forecast for tomorrow:
";
print " - tomorrow it's the ", $tomorrow->date()->date(), "
";
print " - sunrise will be at ", $tomorrow->sunrise()->time(), "
";
print " - maximum temperature will be ", $tomorrow->high(), "
";
DESCRIPTION
Using Weather::Com::Forecast objects is the way to access weather forecast information for one specific location (city) and 0 (today) to 9
days in the future.
Each time you call the Weather::Com::Location objects' "forecast()" method, you'll get an updated Weather::Com::Forecast object. This
object is used to access the 10 Weather::Com::DayForecast objects containing the actual data.
CONSTRUCTOR
new(hash or hashref)
You usually would not construct an object of this class yourself. This is implicitely done when you call the "forecast()" method of a
Weather::Com::Location object.
METHODS
all()
Returns an arrayref of all Weather::Com::DayForecast objects if called in scalar context, an array if called in list context.
day(day number)
Returns the Weather::Com::DayForecast object that corresponds to the day number you provided.
The day number can be any number between 0 and 9.
Day 0 is usually today. Due to a bug (I think it is one) in the weather.com XOAP API, you may get the full forecast data of yesterday if
you call for day 0 just after midnight. I think this may have do something with the timezone. I have not fully investigated this issue,
yet. Please contact me, if you have!
SEE ALSO
See also documentation of Weather::Com, Weather::Com::Location, Weather::Com::DayForecast.
AUTHOR
Thomas Schnuecker, <thomas@schnuecker.de>
COPYRIGHT AND LICENSE
Copyright (C) 2004-2007 by Thomas Schnuecker
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The data provided by weather.com and made accessible by this OO interface can be used for free under special terms. Please have a look at
the application programming guide of weather.com (http://www.weather.com/services/xmloap.html)
perl v5.8.8 2007-07-09 Weather::Com::Forecast(3pm)