Error, text to long when written to file? - fortran

I am trying to plot 2 graphs or more in one graph in gnuplot, but when I try to compile this
write(write_unit,*)'plot ''solchange.txt'' using 1:2 title ''Solchange'' with lines, ''solchange1.txt'' using 1:2 title ''Solchange1'' with lines'
I get the error:
What is going wrong here? The funny thing is that it works with the following code:
write(write_unit,*)'plot ''solchange.txt'' using 1:2 title ''S'' with lines, ''solchange1.txt'' using 1:2 title ''S1'' with lines'
My text is shorter with this code.

It's not the output to the text file that's too long, it's the line of source code. It is longer than 132 characters, so split the line into two using a continuation line.

Related

(C++) Using curses to print new line read in from file

The following is in a text file
To the north, is the entrance to Room 2.\nThere are six suspects in this room:\n\tAdam\n\tSofia\n\tLucas\n\tDaniel\n\tChris\n\tJack\n\tTiana.
This line is being read in and being stored.
I am trying to use printw() to output this with the lines and tabs, however it just prints out as is with the '\n' and the '\t'. What are some possible solutions to this?
Try using the printf() function. By checking the documentation they are the same functions, couldn't find the differences.

Insert a new line after a specific line number

I'd like to add a text of line after a specific line in Notepad++ I have found several similar answers through the web but I couldn't manage to adapt the code without recurring.
This is how my text file displayed in Notepad++
This is sample 1
This is sample 2
This is sample 3
This is sample 4
This is how I want it displayed after applying regex (Find third row, Insert the text without deleting any other line):
This is sample 1
This is sample 2
I insert the text here
This is sample 3
This is sample 4
The code should not search for any word to get a reference point except counting rows until find the specified one. In addition, it shouldn't repeat in the same text file like "every X row". I'd really wonder how it's done inside a batch file but a regex preferable for me.
Thanks in advance.
Just change {3} to {2}to match 2 lines.
Find what: (?:.+\R){2}\K
Replace with: Insert this sample\n

Vb.Net Scraped Data MsgBox Shows Line Breaks but RichTextBox Does Not [duplicate]

This question already has answers here:
Write in new line in rich text box. with vb
(5 answers)
Closed 7 years ago.
So I'm scraping data and I've got my xpath parsing out the line I need.
I go line by line and dump out the data so I know I'm looking in the right place and for every listing it's showing several lines which is good. Exactly what I expected.
Example Msgbox dump:
Msgbox(node.innertext)
Example Msgbox Outputs:
Mr C Moore
10/2
5/1
17/6
Hit OK and the next one comes up:
M D Hunt
1/1
3/1
12/500
And it continues like that for every listing. Great.
I try to split it by environment.newline and get - nothing. Everything is on splitarray(0) so I dump the innertext into a rich text box and everything is squashed up.
Example rich text box dump:
rtbdump.text = node.innertext & environment.newline & rtbdump.text
Example Rich text box output:
Mr C Moore10/25/117/6
M D Hunt1/13/112/500
I need to be able to work with these lines individually. The Msgbox output was clearly able to do that but writing it to a rich text box was all squashed together and splitting by environment.newline doesn't work.
With regex I was able to split the names out - that's a start. But I can't get any further since the numbers have no set pattern or length.
Would appreciate anyone who can point me in the right direction.
I have no idea why this is a thing but apparently splitting by 'vbLf' is different from environment.newline and solved my problem.

line break in google chart api

I am using google map chat api to create a image .I am generating following url
googlechartapi
This is the image i am getting.
But i want "by qwerty" in another line.
I tried to insert or | but it is not working.
Any idea how to do this?
You are looking for something like that I guess :
http://chart.apis.google.com/chart?chst=d_bubble_texts_big&chld=bb|ff0000|000000|hello+world|by+qwerty
Take a look at the multi-line bubble documentation.
The first line will be always larger, and it seems you can't do anything for that.
One or more lines of text, for multi-line text bubbles. Each line is separated by a | mark. The first line will be shown larger and boldface. Spaces must be replaced by +.
https://chart.googleapis.com/chart?chst=d_text_outline&chld=FFCC33|16|h|FF0000|b|Hello+world|by+qwerty
https://chart.googleapis.com/chart?chst=d_bubble_texts_big&chld=bb|FFB573|000000|Helo+world|by+qwerty
explanation:
https://developers.google.com/chart/image/docs/gallery/dynamic_icons?hl=pl-PL#single_line_outlined_text_icon
https://developers.google.com/chart/image/docs/gallery/dynamic_icons?hl=pl-PL#bubbles
?

vim regex : multi-line edit and controlling the cursor position

A text file is formatted like this:
Section 4 Area B Unit 20
stuff i don't need...
stuff i don't need...
45990 - Title of Project that I want to save
line of text I need to keep
line of text I need to keep
2010-11 this line (starting with 2010) is not needed
stuff i don't need
Section 589 Area C Unit 1005
stuff i don't need...
stuff i don't need...
45990 - Title of Project that I want to save
line of text I need to keep
line of text I need to keep
2010-11 this line (starting with 2010) is not needed
stuff i don't need
and these sections repeat by the hundreds. The "stuff i don't need" lines are actually about 30 or so. I need to keep the association of the "Section..." line, "Title..." line and "line of text I need to keep" related to each other. So I was hoping to first destruct the text document down (linewise) to the stuff I need before operating on it further (character-wise). So I wrote this:
g!/\Section\s\d*\sArea\s\h\sUnit\s\d*\n\|^\s\{3}\zs\d*\s-\_.*\ze2010-11/d
After deleting I get the "Section.." line and the "Title..." line, but never the subsequent lines underneath the "Title.." line. Those subsequent lines vary from 4 to 8 lines, but the "2010-11" line is consistent and always what I no longer want.
You can see I tried using zs and ze to select what I do not want deleted. I think the selection is working because if I change the command to "2011-12" then there is no match and the (OR) half of the command does not return a result.
I think the fault might be the cursor position(?), but I'm not sure and my effort to fix that has failed.
Can anyone see my error?
Thanks!
Give this a whirl.
:silent! g/^Section/+ , /^\s\+\d\+ -/- d
:g/^\s\+2010/ , -/\nSection\|\%$/ d
:g finds every line matching start of the pattern, ! will revert the selection and command will get applied to these lines.
Would something like g/^Section.../normal! j2dd3jd} do?
If not you can use a search for the Title line inside normal!
You may need to enclose it in "exec" but may be much simpler to write a function.
Do you really need to use vim? Seems like job for Perl to me.
There are many ways to do t, I'm sure. I think this sequence of commands should work (ignoring comment lines that begin with double quote):
" global delete of line below 'Section' to line before 'Title'
g/^\s*Section/+1;/Title/-1delete
" global delete from date line to line before 'Section'
g/^\s*\d\d\d\d-\d\d/;/^\s*Section/-1delete
" go to top line of buffer
gg
" delete last chunk, from final date to last line
/^\s*\d\d\d\d-\d\d/;$delete