Hi Dw. I'm trying to read a text file. This text file has a multiply lines and what I want is that I want to separate each line or should I say I want to split each line (chop it) so that I will be able to assign these fields to variables using the array. What I first did is to get the lines then for each line I need to break it. The split I'm using the "*" as a separator. Each line will produce/has 13 fields so I want to get these as a variable. Here is just …

Member Avatar
Member Avatar
+0 forum 12

Sometimes we want to not split by every space character, but we want to split only on those outside of brackets and quotes. This way we can have for example quoted string as single argument for command. EDIT: 1. Added hierarchical nesting of same kind of brackets. 2. Bunching multiple separators as single separator, None as general whitespace separator Test output: ---------------------------------------------------------------------------------------------------------------------------------- Hello, (Tony 'pyTony' Jarkko Veijalainen) {'This 'is' quoted' Great to "split" this} split "Also Quoted part" [test test] end Hello, (Tony 'pyTony' Jarkko Veijalainen) {'This 'is' quoted' Great to "split" this} split "Also Quoted part" [test test] end …

Member Avatar
Member Avatar
+1 forum 2

Hi! I am writing my own string splitter and i'm stuck. When I'm trying to split the same string the second time im getting only the first word. Im using Visual Studio 2013. "Name|Phone Number|Account Number|Price|Tariff" Output is : Name Phone Number Account Number Price Tariff Name and my desired output is: Name Phone Number Account Number Price Tariff Name Phone Number Account Number Price Tariff My Code: #include "stdafx.h" #include <stdio.h> #include <iostream> #include <ostream> #include <map> #include <vector> #include <string> using namespace std; int StrTok(vector<string> &vTokens, char* string, char *delim); int main() { char *p_str; char str[255] = …

Member Avatar
Member Avatar
+0 forum 5

!USING PYTHON 3.1! Hello DaniWeb! Today I'm going to teach you a cool variable trick that I learned. So here's an example: [CODE] a, b, c = input('?x?x?: ').split('x') [/CODE] Now let's input something like: [CODE] >>> a, b, c = input('?x?x?: ').split('x') ?x?x?: 1x2x3 [/CODE] Now, variable 'a' is set to 1, variable 'b' is set to 2, variable 'c' is set to 3. I hope I explained that well enough. It can be used in various sections. NOTE: Because you used 3 variables, you [B]have[/B] to have three answers divided by the character you split with. If you …

Member Avatar
Member Avatar
+6 forum 11

Hi all, I followed a tutorial on using the action bar and i face problem trying to split it. All my items just get fitted in to the overflow menu. Please help me with it. Below is my code: AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.androidapptutorial" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".MainActivity" android:label="@string/app_name" android:uiOptions="splitActionBarWhenNarrow" > <meta-data android:name="android.support.UI_OPTIONS" android:value="splitActionBarWhenNarrow" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> MainActivity.java package com.example.androidapptutorial; import android.support.v7.app.ActionBarActivity; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; public class MainActivity extends ActionBarActivity { @Override protected …

Member Avatar
+0 forum 0

Another little adventure into Go coding. This time a slice (a Go open ended array) of structures is used as a record for some data processing. For those who miss the ; at the end of a line of code, you can use them, but the lexer of the compiler will put them in for you. Go slices are simpler to work with and faster than traditional arrays, even though they use arrays as a backbone. Go was written for efficiency and speed of compilation in mind, it is intolerant of unused imports and unused variables. The reason you will …

Member Avatar
Member Avatar
+1 forum 3

so i am trying to output course information when the course number is selected and the button is clicked. here is the html <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Course Info</title> </head> <body> <h1>Course Information Search</h1> <form action="" method="post"> <select name="course" id="course"> <option value="420-121">420-121</option> <option value="420-122">420-122</option> <option value="420-123">420-123</option> <option value="420-221">420-221</option> <option value="420-222">420-222</option> <option value="420-223">420-223</option> <option value="420-224">420-224</option> <select> Select a course to see the course name and teacher assigned<br><br> <input type="button" id="go" value="go!"> </form> <br><br> <div id="courseInfo"></div> </body> </html> php <?php $filename = "data.txt"; try { if ($courses = @fopen($filename, "r")) { while (!feof($courses)) { $line = fgets($courses); $array = …

Member Avatar
Member Avatar
+0 forum 13

Hi, I'm having SlimPDF which used to read PDF & I want to open SlimPDF inside of split panel but it is opening as new window. I tried to open notepad in split panel using my code, works fine but this SlimPDF is not opening inside the panel. Pls help me to solve this issue.

Member Avatar
Member Avatar
+0 forum 1

This piece of code is far from perfect, but it works! It produces a list of substrings (consisting of digits and letters) and their delimiters. If it is practicaly a sin to manipulate the index of a for loop, then I'm a sinner. If two delimiters follow each other, an empty string is produced between the two. If anyone can improve this, please do. Perhaps solutions with Regex or LINQ are possible. Or perhaps the great Ketsuekiame can again come up with a one liner? ;)

Member Avatar
Member Avatar
+0 forum 9

I have a motherboard that supports dual channel DDR2 667Mhz slots with support for up to 4GB. Will I have to put in 2 sticks with each running at about 667Mhz or will I have to have 2 sticks with each running at about 333Mhz to add up to that 667Mhz?

Member Avatar
Member Avatar
+0 forum 2

Hi guys, im working on a bit of code which for 2 days is sending me around in circles :/ what i want to do is split an array into variables, so i can dynamically create a text box. i'm trying various methods but think im chasing my tail now. $input_array = array($forSplitProduct); print_r($input_array); echo '<br>'; echo '<br>'; list($a) = $input_array; //echo $a; for($i = 0; $i < count($a); $i++){ // print_r($a); $b = explode(",", $a); // print_r($b); for($i = 0; $i < count($b); $i++){ print_r($b[$i]); } } echo '<br>'; echo '<br>'; $b = explode(",", $a); print_r($b); that code outputs: …

Member Avatar
Member Avatar
+0 forum 5

Im working on a code that loops through a folder break up the file names in it into specific parts and then reads off sertain parts of the broken name and writes it to a csv sile. The files ser formated as follows test_PAQT_B2H.csv, test_PAQT_B4.csv, and test_PINI_B1H.csv. when it jsut has one file type like just AQT files it works fine but when there is INI files in it when it writes to the csv file for results it writes the ini file multiple times messing up the readability of the data. I jsut want to know how to get …

Member Avatar
Member Avatar
+0 forum 5

Hello all, I am working through Beginning Microsoft Visual C# 2008 I was asked to create a console application that multiplies 4 input values. I decided to take all 4 values at once and multiply them. Here is my code: string inputNumbers; string userName; Console.WriteLine("Enter your name:"); userName = Console.ReadLine(); Console.WriteLine("Welcome {0}!", userName); Console.WriteLine("Now give me 4 numbers seperated by a space:"); inputNumbers = Console.ReadLine(); string[] numbers = inputNumbers.Split(' '); Console.WriteLine("The product of {0} * {1} * {2} * {3} is {4}.", numbers[0], numbers[1], numbers[2], numbers[3], Convert.ToDouble(numbers[0]) * Convert.ToDouble(numbers[1]) * Convert.ToDouble(numbers[2]) * Convert.ToDouble(numbers[3]) ); Is there an easier way to …

Member Avatar
Member Avatar
+0 forum 4

#Import Story text = open('./alice.txt', 'rb').read() #Split the text into individual words def split_text(text): #Import known words index index = open('./words.dat', 'rb').read().split() index_file = open('./words.dat','wb+') for word in index: index_file.write(word) index_file.write('\n') import string #Remove punctuation out = "".join(c for c in text if c not in string.punctuation).lower() # split the text words = out.split() # for each word in the text: word_count = 0 for word in words: if word.endswith('.') or word.endswith(',') or word.endswith('"') or word.endswith('”'): word = word[:-1] if word not in index: index.append(word) index_file.write(word) index_file.write('\n') word_count = word_count + 1 print ('The total amount of new words is:') …

Member Avatar
Member Avatar
+0 forum 9

In the last few days, I have noticed a very old thread ... resurrected ... about a non-standard C getline function. To all who may like a C readLine function ... a C function that reads in a dynamic C string of any length ... a function with a similar feel to the C++ getline function ... please feel free to use readLine.h (to access readLine) ... or readWord.h (to access readWord) These are freely available at: [For ... readLine and readWord ... Click Here](http://developers-heaven.net/forum/index.php/topic,2580.msg2864.html#msg2864)

Member Avatar
+0 forum 0

Facing issue when splitting a image ,when image size is bigger,it split only part of tht image or i want that any size of image show properly according to div size after splitting.`Inline Code Example Here` <!doctype html> <html> <head> <meta charset="utf-8"> <title>jQuery PicStrips example</title> <!--<link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet" type="text/css">--> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="picstrips-1.0-min.js"></script> </head> <body> <div id="jquery-script-menu"> <div class="jquery-script-center"> <ul> <li><a href="http://www.jqueryscript.net/other/jQuery-Plugin-For-Splitting-An-Image-To-Strips-PicStrips.html">Download This Plugin</a></li> <li><a href="http://www.jqueryscript.net/">Back To jQueryScript.Net</a></li> </ul> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script></div> <div class="jquery-script-clear"></div> </div> </div> <h1 style="margin-top:150px;">jQuery PicStrips example</h1> <div class="demo"><img src="Fulmer_Falls_Wide_View_3000px.jpg" width="600px" height="300px;" id="example"></div> <script> $("#example").picstrips ({ splits: 2, hgutter: '5px', vgutter: '0px', bgcolor: '#fff' }); </script> …

Member Avatar
+0 forum 0

Hello, I have one big XML file (600 MB - 850 MB) in format "**cells_yyyymmdd_hhmi.xml**" I would like to specify that everyday i will have new file with new date. So, *there should be general way to read it and cut it*. For exmaple, i have file of 7th January. Its, cells_20140107_154016 Goal is to split into small parts by shell script and do operation. It will be great if anyone can give input to check the filesize and if it is too big, make 4 parts instead of 3 parts. I did so far: head -1125000 cells_20140107_154016.xml > PART1.xml …

Member Avatar
Member Avatar
+0 forum 1

Am working on a project right now and almost stuck at a point. Say, I have a text document with contents like: `abc,123.xyz;praise;end,file,clear` Now I want abc , 123 . xyz ; praise ... in an array. I used split method with array of characters. Though I retrieved abc,123,xyz,praise,end,file,clear I couldn't retrieve , . ; ; , , ,. I need every different characters in text file. #region Splitting string splitSamp = "abc,123.xyz;praise;end,file,clear"; string[] splitSampArr = splitSamp.Split(',','.',';'); string[] myText=new string[splitSamp.Length]; int i=0; foreach (string splitSampArrVal in splitSampArr) { Console.WriteLine(splitSampArrVal); myText[i]=splitSampArrVal; i++; } for (i = 0; i < 10; i++) …

Member Avatar
Member Avatar
+0 forum 5

Am working on a project right now and almost stuck at a point. Say, I have a text document with contents like: `abc,123.xyz;praise;end,file,clear` Now I want abc , 123 . xyz ; praise ... in an array. I used split method with array of characters. Though I retrieved abc,123,xyz,praise,end,file,clear I couldn't retrieve , . ; ; , , ,. I need every different characters in text file. I imported the files to a rich text document control using file dialog. I want the the string in a variable say myText (it is an array) myText(0)=abc myText(1)=, mytext(2)=123 myText(3)=. myText(4)=xyz *and …

Member Avatar
Member Avatar
+0 forum 9

My eMachine Laptop screen is splitted into 2.. the other one half looks darker.

Member Avatar
Member Avatar
+0 forum 2

Hello, I am new to VBscripting and hope someone can help clarify the split options. I just started learning VBscrpiting a few weeks ago and Im trying to figure out how to do something. I haven't learned anything other than the basics so this question might seem super simple. If I have an inputbox and lets say I punch in a string consisting of this... test,script!are:Awsome@ and I wanted the following message box to split apart my line piece by piece.. I want to give an explaination message of each word. I figured out how to split them, but I …

Member Avatar
Member Avatar
+0 forum 2

I have a csv file with lines like this example: 14," APPLES, GRANNY SMITH 72 CT usa, Case",101-016,40.00,7/16/2013,7/22/2013 14," APPLES, GRANNY SMITH 72 CT, Each",010-017,0.60,7/16/2013,7/22/2013 I need to do a few things here - I need to remove any surrounding quotes from around fields; I also need to split the third field into two separate fields; lastly I need to change the field separator from comma to tab. For example the two example lines above should end up looking like this: 14\tAPPLES, GRANNY SMITH 72 CT usa\tCase\t101-016\t40.00\t7/16/2013\t7/22/2013 14\tAPPLES, GRANNY SMITH 72 CT\tEach\t010-017\t0.60\t7/16/2013\t7/22/2013 I am new to Python and am having …

Member Avatar
Member Avatar
+0 forum 1

I'm trying to get the time from input of html txt_URL but the array returns nothing. Not sure where I went wrong. Any help is appreciated. Thanks! **input:** Deleting 11 files. Details: Time Deleted = 01:16:30, Time Left = 00:00:00, **output:** 01:16:30 string before = txt_URL.Value; string after = Regex.Replace(before, @"[ =.]",","); string[] strValues1 = after.Split(','); Text2.Value = strValues1[7];

Member Avatar
Member Avatar
+0 forum 3

hello. I need to dedupe e text. meaning if i have an array with stored strings, it will check and compare each row of array with each other to test if text[i]==text[i+1]. to dot this i thougt to catch the text from an input, ex:text are and consider it as a long string. then each space between words to be considered as new line and to be entered into the array. sample: `$string1="aa bb cc aa";` what code should i type here so it can become like this: `$array1=array("aa","bb","cc","aa");` and at the end afer dedupet it will posted: aa bb …

Member Avatar
Member Avatar
+0 forum 4

hi all, newbie wanna ask... if i have string sent from serial comm, lets say the string is like this : name1 name2 name3 how can i split that string into separate string, lets say i will put name1 into textbox1, name2 into textbox2, name3 into textbox3? thanks for the help.

Member Avatar
Member Avatar
+0 forum 20

A function to take a text and extract the string between two given substrings. Allows you to find the nth occurence. Also safeguards against dead ends.

Member Avatar
+2 forum 0

Hello guys I need a favor, I have array of data fetched form mysql db and contain 4 information **id - thumb - views - added by** I want to display those arrays in 3 or 4 coloumn like picture gallery. I did it with only picture and its work ![gtest1](/attachments/large/3/gtest1.jpg "gtest1") but when I try to add information under it its show in vertical I need to devide the results into 3 or 4 column and each result look like this ![gtest2](/attachments/small/3/gtest2.jpg "gtest2") Tried this but its useless <? while($data = mysql_fetch_assoc($rs)) { ?> <span><a href="details.php?pic=<? echo $data['id']; ?>"><img …

Member Avatar
Member Avatar
+0 forum 11

**Hi forum, I've got a question for the pros. I am making a program that has map<String, String> map = new TreeMap<String, String>(); and a Scanner to read a file contains some data which is assigned to map.put(); method. The data is something like this: UK USA Canada Australia etc. The country names are separated with a "tab". All the data is on one line of a text file. I just want that when I print the country names and when system prints the data up to 5 tabs it will start a new line and then print the other …

Member Avatar
Member Avatar
+0 forum 6

Hi, I am coding some python to work with some wireless serial devices. I have 2 devices reading temperatures and other environmental data over an Xbee which then writes the data over serial. The data looks like this when read in Hex: *7e001090007d33a200408b2e0c2db7010016005763* The important character is the 7e at the beginning which is the start delimiter for the packets - device information and sensor data follows that. I have the following up to now: import serial ser = serial.Serial('com6',9600,timeout=1) while 1: Data_in = ser.readline().encode('hex') if Data_in[0:2] == '7e': Data_in.split('7e', -1) print "==========================" print "Found Packet: " + Data_in if …

Member Avatar
Member Avatar
+0 forum 3

Well, I have just made this funtion that will split an array using a delimiter. I'm new to C++ so I will take any suggestions you have. Anyhow, good luck! Enjoy!

Member Avatar
Member Avatar
+0 forum 7

The End.