Extract From File
ok I'm trying to extract information from a text file which i do not know the length of. the first line reads
" Todays highest temperature is 23 C 24/01/2004" (there could be numerous lines ) each with different temperatures and also the dates will be different 'cos you input the temperature everyday.
this code does some of it can i use a loop do extract the data i need,
also not quite sure how to fill the temperatures and the date into arrays?
here is my code:
Dim String1 As String ' textfileDim sNum() As Integer ' array to store the temperaturesDim sDate() As Integer ' array to store the datesDim Num As IntegerDim sString As String ' temp temperature store String1 = Text1.TextString1 = Replace(String1, " Todays highest temperature is ", "") ' remove this sentenceString1 = Replace(String1, "C", "") ' remove CelciussString = Mid$(String1, 2, 2) ' extract first number which is the temperatureNum = CInt(sString) ' convert string to integer String1 = Replace(String1, Date, "") 'remove dateDebug.Print NumDebug.Print Date frmChart.Text2.Text = String1 frmChart.ShowEnd Sub
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Opening A File, Extract Data And Send A File Via Infrared
I am new to this forum and also new to Visual Studio. I need to produce a program which does the following...
1.Use System File Watcher to know that a file has been received in a particualr directory from a mobile phone.
2.Open that file with notepad (the file is not opened by notepad by default), Find the word 'Body:' and save the string found after it.
3.Send via infrared, a file '.jpg' loacated in a particular directory with the same string name as the one stored.
Can you kindly suggest to me some coding?
or at least some website where I can get some tips, tutorials, help.... Cause I don't have the MSDN help installed!
The coding I require is on how to open the file (which is arrived and systemfile watcher noted) with notepad..and how to extract data from it.
Programittically Download A Zip File And Extract The Csv File Into A Bcp
This is a pretty tough one. There is a website PJM.com that contains energy pricing data in csv format. The file names are by date, ex. 20001129-da.csv The da is for Day Ahead pricing. the way the program is designed, based on the date, it creates a file with the same as the one the web site that is going to be downloaded into. The pprogram then takes the data from the website and inputs it into the file that the program creates with the same name using msinet.ocx and inet1. THIS WORKS JUST PEACHY.
The problem I am having is that past data is zipped up into a directory that contains 4 subdirectories and finally the last one contains the file. I am not sure how write a program that will extract the data from that zip so that it will be stored in the root directory where all of the other csv files are contained. I need some serious help on this one. Thanks in advnace.
Web App Developer
How Can I Extract A .RAR File Using VB6??
It's really nice to be here.. well i'm a new mmbr in here, n i got a little question..
How can i extract what's in a .RAR file using VB6??
could any 1 plz help??
Extract From WP 5.1 File
I want to extract some lines from WP 5.1 documents and write the extracted lines to a CSV file for future import in a database or Excel file. All WP documents is build of several pages – and each page contains one (1) table with different structures. The lines I want to extract from, are all the rows that include 7 columns and where the first columns first character are a digit. Each row must be written as a line where the contests of each column are separated by semicolon. I don’t want to run or open any other programs then my own VB-app. If anyone know how to do this I would really appreciate the help! Thanks in advance!
Marci Sarwan (email@example.com)
P.S. If it's not too much trouble can you please provide some sample code with the solution. Thanks a million!
Extract Zip File
Is it possible to extract a zip file from visual basic application ?
Extract Image From File?
I'm looking into using DirectDraw for a skinnable program (yes, it's probably overkill, but it works so well) but I want the skin to be a single file and let it contain multiple images (so I only load in memory the ones I need) and also values for colors, text, and other information. I'm new with DirectX and I've used the CreateSurfaceFromFile to create a surface, but I really don't want to extract the image, save it to a temporary file, and load it in. I'd rather load it from a binary red directly. Is there a way I can get DirectX to see information in that sense as an image?
Extract Text From .doc File
Here is the first draft of my procedure to retreive but text from a .doc file, but it seems that embeded objets are a real hassle to remove from the text as I have not yet found then starting and ending quotes or chars delimiting the embeded object.
I would appreciate a hand on the subject
Private Sub Command1_Click()
Dim fichier$, numfile%, textfromfile$, lastpos%, i%
Dim Remplacements$, Suppressions$
Dim TabSupp As Variant
If LCase(Right(CommonDialog1.FileName, 4)) <> ".doc" Then
MsgBox "Ce n'est pas un fichier .doc"
fichier = CommonDialog1.FileName
numfile = FreeFile
Open fichier For Binary Access Read As numfile
textfromfile = Space$(LOF(numfile))
Get #numfile, , textfromfile
textfromfile = Right(textfromfile, Len(textfromfile) - 1536)
'and here I end up with text and embeded objects, I need to know where an embeded object starts and where it ends to be able to remove it from text
'verification des embed
Dim StartPos&, EndPos&, StartCount&, EndCount&, StartChar$, EndChar$
StartPos = 1
EndPos = 1
StartChar = Chr(19) '
EndChar = Chr(20) & Chr(1) & Chr(21)
Suppressions = "1,2,3,4,5,6,19,20"
TabSupp = Split(Suppressions, ",")
Remplacements = "7,8,9,10,11,12,13,149"
TabRemp = Split(Remplacements, ",")
For i = 0 To UBound(TabSupp) - 1
textfromfile = Replace(textfromfile, Chr(TabSupp(i)), vbNullChar)
For i = 0 To UBound(TabRemp) - 1
textfromfile = Replace(textfromfile, Chr(TabRemp(i)), Chr(32))
Text1.Text = Trim(textfromfile)
How To Self Extract Exe File In Vb (URGENT)
I have created an exe file but don't know how to open or run it back in vb6. My exe contains a self extracted zip file, and I need these files to run my vb program. Can someone please give me some ideas? Thank you!
Extract Binary File
I need to read and extract binary file. The binary will contain header message and raw data in the middle. My program needs to identify the header and then read the raw data. Please help me or give direction on how to extract binary file. Thanks
Any Way To Extract Code From .exe File?
Hi, I've just created a Encrypting / Decrypting program, and would like to know if theres anyway to to extract the code. I made he .exe, but accidentally deleted the forms . All I have is the project file.
Extract Resource File?
Is there code out there that will allow me to extract the resource file from a vb executable? I want to grab the languages from the resource file.
Extract Only One File From Winzip
I have a winzip file consisting of multiple files and folders. I just want to extract a single file out of it via VB. is that possible?
Extract File From Database
I want to know that how to retrieve a video file from ms-access database embeddas
as ole object and then play it in window media player control. I know how to save image and retrieve it
but to to eal with .avi files.
How To ADD/EXTRACT Files To A .Res File
I need to know a little more, how do i add files (my .exe and its dependencies) to a .Res file... and then how do i add that .Res file to another .Exe file that can UNPACK the files from the .Res file and run them...
So that I can send my users ONLY one .Exe file.... ??
I've read up on the forum,but not found a good/understandable/working explanation...
So i need to know:
-How to make the .RES file in VB6
-How to add .EXE and .OCX/DLL to it
-How to pack that .RES file into another .EXE and have that .EXE
unpack the files that were packed in the .REs file,and then run the .EXE it just unpacked...
Can anyone please explain that,since a lot of you seem to know how to do this... ???
Extract Information From A PDF File
Dear all you,
Would you please give us your instructions on the following questions:
- A brief description about structure of a PDF file.
- How I can extract an image, all text value with text's layout from a PDF file by using VisualBasic6.0. VB.Net source code.
Please mail to me at: firstname.lastname@example.org
Thank you in advance.
How Do I Extract A Byte From A File?
I want to get the byte and that he will be deleted from file.
how do I do that?
sorry if i'm repeating my questions.. i didn't find the answer...
Extract Text From File
[file.1.2.3]: Found: jason/lpz !!!
how do i get:
file.1.2.3 = string1
jason = string2
lpz = string3
Extract File Icons...
I am showing files with their path, size and creation date in report style listview control. I also want to show file icons in the control just like Windows File Search. Can you tell me how can I extract file icons ??
Extract From Excel File
I want to extract information from an Excel file using VB version 6 and then put this information into the corresponding fields in an SQL database.
I think it would be easiest to extract the info from the excel file and put it into a recordset.
Any help would be much appreciated,
Extract An Icon From An Exe File
i want to use as my app icon say the icon of notepad is there a way to extract it ? i do not want to use screen capture cuase the icon i get is not exaclty the same
How To Extract Attachments From .eml File?
i need a way to extract the attachments from a .eml file. It needs to be able to work for .eml files anywhere on the computer and not just in outlook folders. For example if I had a file at C: heemail.eml i would want to extract the attachment from it to C: heattachment.exe, any suggestions or code would be appreciated.
Extract Part Of A File
Hello, I'm new here.
Hope you can help with the following problem...
I want to extract a part of a file.
I want to send this part, say the first and last 64 bytes of the file to a function.
Does anyone of you know if that's possible and if so, how to do that in VB6 ??
Ask for more info if you need it.
How To Extract Info From A .wav File?
Does anyone know how to extract data from a .wav file.
I dl a trial version of a program to convert an mp3 to
a wave file. But after the 30th time it adds some stuff
to the file that I don't want. And I need to know how to
get rid of it. Any suggestions would be appreciared.
How Do I Extract An Icon From DLL-file
I have a really serious problem. I was building my own explorer but when it came to adding icons I got stuck. You can retreive the file association from the registry, and in the registry it also tells you where the program Icon is located and an integer number. But I don't know how to use this information.
Anyone help me please!
Extract DNA Sequencing File AB1
I have a problem need your help. My VB program will need input a DNA sequencing raw file with the external of ab1 as the data resources. how can I write code to display the figure and the sequencing text file?
Extract VB Code From MDE File
I work on a big company and i was tell to modify an Acces DB System, the problem is that i was only provided with the mde file and they donĂ‚Â´t have de mdb one. I just need to extract the VB code from the forms, specially one of them, i've tried to unblock de mde but it doesn't let me add new VB components to de form, so, if i can't extract the vb code i'll have to do it all from the bottom.
Thank for any response...
How To Extract Image From A AVI File?
I have developed an application to play a AVI file. I wish to have a image (possibly .gif or .jpeg) generated for a particular AVI frame. How do I achieve this?
Thanks in Advance!
Extract An Image From File *.dll
hi anybody, can you explain how to extract an image(icon) in a *.dll file like shell32.dll
Edited by - Need Guru help on 6/24/2008 12:04:04 AM
Extract .MP3 From .SWF (flash) File
I am trying to extract an mp3 sound file from a flash video or swf file. I have had no leads so far as to how i could do this. Let alone i have only found one free program that will do this,swfextracter.exe.
Any help would be appreciated.
Edited by - crazyoldman on 6/18/2007 6:53:35 AM
How To Extract Image From A AVI File?
I have developed an application to play a AVI file. I wish to have a image (possibly .gif or .jpeg) generated for a particular frame. How do I achieve this?
Thanks in Advance!
How Do I Extract Certain Fields From A Text File?
Please excuse me for this question, I know there is a real easy answer to this (I hope), but I have spent all day and none the wiser. I also read the I/O Tutorial by Gavin.
I have written a procedure which creates a text file with fixed width records. The data within the file is not delimited and always at a specific location in the file, i.e;
Record1 - "John Smith 10 Alphabet Street Somewhere ACity"
Record2 - "Paul Wilks 4 Forrest Road Anotherplace BCity"
Now I need to read the file, and actually be able to extract the individual parts of the file (like the First Name, Surname etc...) into variables/strings so that when I re-output the file I can re-order it, add/amend data and add delimiters as I see fit.
Im quite new to VB6, and from the Old School of Cobol where something like this is straight forward.
Extract Icon From File Then Save It
I write a program. I want to extract icon from a file then save the icon into a file. I use GDIPlus which provide by OnErrOr. But when I save it, it pop up an error message:
"Method 'hPal' of object 'Picture' failed"
I found the problem is Picture1.Picture doesn't have any Palette. I try to create one for it, but I failed.
Does anyone can give me a hand?
Thank you ^_^
My code as below
Option Base 0
Private Const MAX_PATH = 260
Private Const SHGFI_ICON = &H100
Private Const SHGFI_OPENICON = &H2
Private Const SHGFI_SELECTED = &H10000
Private Const SHGFI_TYPENAME = &H400
Private Const SHGFI_SHELLICONSIZE = &H4
Private Const SHGFI_SYSICONINDEX = &H4000
Private Const SHGFI_DISPLAYNAME = &H200
Private Const SHGFI_SMALLICON = &H1
Private Const SHGFI_LARGEICON = &H0
Private Const SHGFI_EXETYPE = &H2000
Private Const ILD_TRANSPARENT = &H1
Private Const flags = SHGFI_ICON Or SHGFI_TYPENAME Or SHGFI_SHELLICONSIZE Or SHGFI_SYSICONINDEX Or SHGFI_DISPLAYNAME Or SHGFI_EXETYPE
Private Declare Function SHGetFileInfo Lib "shell32.dll" Alias "SHGetFileInfoA" (ByVal pszPath As String, ByVal dwFileAttributes As Long, psfi As SHFILEINFO, ByVal cbFileInfo As Long, ByVal uFlags As Long) As Long
Private Declare Function DrawIcon Lib "user32" (ByVal hDC As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Type SHFILEINFO
hIcon As Long
iIcon As Long
dwAttributes As Long
szDisplayName As String * MAX_PATH
szTypeName As String * 80
Private WithEvents gdip As cGdiPlus
Private Sub btnLoad_Click()
Dim info As SHFILEINFO
Dim retval As Long
retval = SHGetFileInfo(txFileName.Text, 0&, info, LenB(info), flags Or SHGFI_LARGEICON)
retval = DrawIcon(Picture1.hDC, 0, 0, info.hIcon)
Private Sub btnSave_Click()
Dim name As String
name = txFileName.Text + ".gif"
If gdip.PictureBoxToFile(Picture1, name) Then
MsgBox "Sucessfully saved file: " + name
MsgBox "Could not save file"
Private Sub Form_Load()
Set gdip = New cGdiPlus
Picture1.AutoRedraw = True
How To Extract Data From A Text File??
Hi. Im relatively new at VB, so still learning. Im trying to build a program that will extract a number from a text file. The file gets populated automatically, with data in the following format.
09:47:18 Order 17000 boxes @ 15.30 for A15 order number 5182348 in regular market.
09:47:18 Trade 13228506 sold 3000 boxes @ 15.30 for A15 order 5182348 remaining 14000 Regular market.
09:47:18 Trade 13228507 sold 5000 boxes @ 15.30 for A15 order 5182348 remaining 9000 Regular market.
09:47:18 Trade 13228508 sold 2000 boxes @ 15.30 for A15 order 5182348 remaining 7000 Regular market.
09:47:18 Cancelled, Sell 7000 PCCL @ 15.30 for A15 order 5182348 in Regular market.
The first line always contains the order details.
The second line onwards contains details of each trade individually.
The last line contains details of any possible cancelled order.
What I need to extract is the total quantity of boxes sold. So from the second line, i need 3000, third line, 5000 and fourth line 2000. So i just need the total, which is 10,000 in this case.
Can anyone give me pointers on how to calculate this value accurately? Thanks a lot.
Extract A Single File With InfoZip
I'm using infozip to extract files from a zip:
Using this code:
Set m_cUnzip = New cUnzip
m_cUnzip.UseFolderNames = True
' Set the zip file:
m_cUnzip.ZipFile = App.Path & " his.zip"
' Set the base folder to unzip to:
m_cUnzip.UnzipFolder = "C: hisplace"
m_cUnzip.FileSelected(1) = True
' Unzip the file!
But I'm not sure how to use FileSelected to extract a single file. The file I want to extract is build.dat
What exactly do you specify in the FileSelected property?
Extract Image From File (Preview)
does anybody know how i can use the real cool API-Function
(shows an PreviewImage).
here is the discription:
Extract Variable From Text File
I have an interesting question. I havea text file(.txt) and about halfway through it there a a variable (vr=XXXX). This file is the output of another program and I need to read that variable and assign it a new name.
Extract String While Reading A File
following is the file format which i need to read...how can i extract only the string present in doble quotes such as
"1000" and so on from the file and display it in combobox...how can i do tat
223518 223590 223596 223636 223640 223645 223717 223723 223763 223767 $
223772 223844 223850
GROUP NOM "SNAP_UP_noe" NOEUDS
I 223869 223870 223871 223872 223874 223899 223900 223901 223902 223904 $
223929 223930 223931 223932 223934 223959 223960 223961 223962 223964 $
223989 223990 223991 223992 223994 224019 224020 224021 224022 224024 $
224049 224050 224051 224052 224054 224079 224080 224081 224082 224084 $
224109 224110 224111 224112 224114 224139 224140 224141 224142 224144 $
225241 225242 225243 225245 225287 225288 225289 225291 225321 225322 $
225323 225324 225326 225368 225369 225370 225372 225402 225403 225404
225405 225407 225449 225450 225451 225453 225483 225484 225485 225486 $
225488 225530 225531 225532 225534 225564 225565 225566 225567 225569 $
225611 225612 225613 225615 225645 225646 225647 225648 225650 225692 $
225693 225694 225696
.SEL GROUP "1000 " NOEUDS
I 217461 217462 217463 217465 217467 217469 217471 217473 217474 217475 $
GROUP NOM "IS_noe" NOEUDS
I 400000 400001 400002 400003 400004 400005 400006 400007 400008 400009 $
400010 400011 400012 400013 400014 400015 400016 400017 400018 400019 $
GROUP NOM "IS_CORNER_noe" NOEUDS
I 400000 400001 400002 400003 400004 400005 400006 400007 400008 400009 $ NTRI 1
400010 400011 400012 400013 400014 400015 400016 400017 400018 400019 $ NTRI 1
400020 400021 400022 400023 400024 400025 400026 400027 400028 400029 $ NTRI 1
400600 400601 400602 400603 400604 400605 400606 400607 400608 4006
Extract Data From Text File
i want extract data from "sample.txt" and save the data which have been extract to a new text file.
when have "START 129, S",then get the data below it & before the "stop"
START 129, S, 125=1;156=1;133=300000
START 129, S, 125=1;156=1;133=250000;93=1
data after extract is like below:
how to write the code?
Extract Text, Sent To Excel File
I am a bondsman, and I have a text file that is sent to me, sometimes daily. It is in the format of a text file. The problem for me is that each record is 3 or 4 lines deep. I would like to export the data from this text file into an Excel worksheet.
The way the report comes to me currently isn't user friendly the way that it is.
I am expecially interested in the following items.
from the 1st record:
File Number: 06CR 052172
Defendant Name: Xxxxx,Xxxxxx,Xxxxxx
Bond: $2,000 Sec
There may be as many as 300 records to pull this data from.
It is always laid out in this manner. I can not change this.
Thanks for your help.
I have attached a small sample of the file as I receive it.
How Do I Extract Only Certain Data From A Text File?
At the suggestion of Martin Liss, I've started a new thread for this question.
I have a text file that contains a lot of verbiage, followed by data that is arranged in rows and columns (ala Excel), which is then followed by verbiage and then rows and columns of data and so on. The verbiage can be any length, as can the rows and columns of data also be of any length.
What I want to do is to, when a group of data in rows and columns is detected, take that data and put it into an Excel file, and when the next group of data is detected, place that data into a new Excel file, and keep on doing this until the txt file EOF is encountered.
One issue is that the row and column data can span multiple pages, which means that page headers and footers can be interspersed throughout the data I want to extract.
If I have a group of data that spills from one page to another page to another page and so on, how might I keep all of the data in one file while records are being processed?
I've attached a small sample file for review.
If anyone can help with this overall question, I sure would be happy to hear what you all have to say. Thanks so much in advance!! Looking forward to it.
Extract From Or View Contents Of An MSI File???
I have an old MSI installation file and I want to look at the contents to see the dates on files etc... Does anyone know if there is a solution on viewing/extracting from MSI files created with the Visual Studio installer?
Extract Embedded Excel File From EML?
I need to write a routine to read in an EML file an extract out of it the attached XLS file. The EML file contains the email header info and then the rest of the file contains the binary XLS file.
Does anyone know how to do this?