bunch of weird characters instead of text - sql

I really count on your help.
Well, for hours I've been trying to have my excel files inserted in sql database as a table through the msvs and no matter what I have tried, the output data is always some sets of weird characters, boxes and etc. First I thought that it could be the PC language settings, I've tried changing them to my local one, changed the system locale to my own language and etc. But there was no result.
Then I just opened an excel file, typed there a single letter "d" and tried to open it in notepad++ to check whether the result will be the same or not. It was again a big pile of boxes and symbols instead of single letter "d". *Tried to change the encoding in notepad++, didnt work either.
Do you have any idea what can help me? It's really frustrating.
Thanks
Sabuhi.

Of course that happens, this is common behaviour when you are trying to open a compiled program in a text editor.
As #Gary'sStudent suggested, if you want to open the excel file
directly in a text-editor, it needs to be saved as .csv
Ctrl+Alt+S
Select the .csv file type:
Save (may need to adjust your table data to fit the .csv formatting
Either way, it sounds like you're a bit confused with what you're trying to achieve. If you want to export your Excel file as a database (which has it's own quirks and is not exactly the best approach to databases) then you should be able to view your database in your database editor - whatever you're using, after you have imported it and compiled it, instead of trying to open it in a text file!

Related

How to read a .csv file embeded in a Word file

I currently am working on an MS Word form where I use VBA to import data from a .csv file. The form is a phone request for employes who work outside, and my .csv is a list of phones that is updated for time to time. My boss would like to have this .csv directly into the Word to have only one single file to handle.
I found how to include (embeded) it, I go to "insert" tab on the ribbon, "Object" button, then "Create from File" tab. I check "display as icon" but not "Link to file".
My .csv is only used to import data through a macro when opening the Word form. Data are then paste in a variable that is handled in VBA to fill combos. The .csv is periodicaly updated and re-embedded so the form is updated also. I don't plan to alter the .csv in VBA in any way.
The objective is eventualy to give the Word document to someone else who will embed a new .csv when needed, but won't look at the code.
The problem I am working on is to reach the .csv and import data.
Another solution, thanks to #Cindy Meister's and #SlowLearner's comments for pointing out the idea, would be to use Custom XML Parts. I will make some additional researches about that.
Moreover, with my currently very limited experience on programming and VBA, I'm not sure how to handle that (I'm not even sure it's possible). The lack of quality documentation on VBA doesn't help either.
After comments of #Cindy Meister and #SlowLearner, I reformulated part of the question to be more precise, although I feel it's getting very long and and messy. I probably should make my own research to narrow down the problem.
ps: that's my first question here, so any advice is welcome, and please be nice with me :)

How to read a Executable(.EXE) file in OpenVMS

When am trying to open any .EXE file am getting information in encoded form. Any idea how to see the content of an .EXE file ????
I need to know what Database tables are used in the particular .EXE.
Ah, now we are getting closer to the real question.
It is probably much more productive to ask the targeted databases about the SQL queries being execute during the run, or a top-ten shortly afterwards.
The table-names might not be hard-coded recognizably as such in the executable.
They might be obtained by a lookup, and some fun pre-fixing or other transformation might be in place.
Admittedly they like are clear text.
Easiest is probably to just transfer to a Unix server and use STRINGS on the image.
I want to include the source here with but that failed, and I cannot find how to attach a file. Below you'll find a link OpenVMS macro program source for a STRINGS like tool. Not sure how long the link will survive.
Just read for instructions, save (strings.mar), compile ($ MACRO strings), link ($link strings), and activate ($ mcr sys$login:strings image_to_test.exe)
OpenVMS Macro String program text
Good luck!
Hein
Use analyze/image to view the contents of an executable image file.
I'm guessing you are trying to look in the EXE because you do not have access to the source. I do something like this:
$ dump/record/byte/hex/out=a.a myexe.exe
Then look at a.a with any text editor (132 columns). The linker groups string literals together, and they are mostly near the beginning of the EXE, so you don't have to look to far into the file. Of course this only helps if the database references are string literals.
The string literal might be broken across a block (512 byte) boundary, so if you use search in your editor, try looking for substrings.
Aksh - you are chasing your tail on this one. Its a false dawn. Even if you could (and you can't) find the database tables, you will need the source of the .exe to do anything sensible with it, or the problem you are trying to solve. Its possible to write a program which just lists all the tables in a database without reading any of 'em. So you could spend and awful lot of effort and get nowhere. Hope this helps

Select three rows of text in PDF using VBA

I am trying to use VBA to select three rows of data in a PDF file and copy them to the clipboard. I have tried third party libraries but I still can't seem to find a simple solution. I can use the cursor to select the data and copy it, so I just want to automate this step with VBA.
I have looked high and low for an answer to this and I feel like it might be really simple and I'm just missing it. I assume I could just use the "highliteList" method in the acrobat library to select the rows, but I don't know how to specify where to begin the selection. There is a header on each page, so I just want to say something like:
For Each header In pdf.pages
NextLine.SelectRow
NextLine.SelectRow
Next header
Selection.CopyToClipboard
Is this possible? I know those methods probly don't exist, I was using it as an example. Does anyone have experience with doing this? Thanks in advance for any help
I found a solution for all those interested. I used Bytescout PDF extractor library to convert the file to .xls format. Then I just parsed out what I needed in Excel since Excel is easy to work with via vb.net.

Export from .xls to .sql / creating sql queries

Okay guys, I've been having this problem for a few weeks now and I'm getting no-where with it. I have OpenOffice and regular Office softwares. Both produce flawed .csv files, or at least phpMyAdmin can't read neither of these. Yes, I've been trying to change server's settings of uploading, etc. I also tried to contact my web hosting service and they claimed that all the .csv files I've produced are flawed.
Anyway, I'm looking for a way to convert .xls table to SQL. Most of the softwares out there cost money that I don't have. Furthermore, I've seen PHP systems that do just that, so I know this is possible.
No need converted to. sql, you can import directly with phpmyadmin or using tools like navicat for mysql in phpmyadmin go to the option to import, find the file, select the file type (csv or csv loaddata), in part below defines the column separator (if you do not know which opens the file with notepad)
if a very large file using navicat.
Flawed is "defective"?. I assume you have problem with excel, maybe you have defined the same column separator for separating thousands or decimals, use openoffice to open the file

Extract Tabular Data from a PDF and sort it

I have a PDF file which has the marklist of certain exam.
I am particularly interested in the first list, but which unfortunately has 2112 entries. And they aren't properly formatted. I need to sort all these entries (based on marks in last 2 columns- sum of marks in Aptitude and Computer), to know what my rank is.
I tried to copy in in MS Word and Excel, but if you try it, you can see it won't help. After pasting it in a plain text file, I tried to format it using regular expressions (in Notepad++), wrote a code in C to properly separate each field by '\t' (so that later I can properly copy them in an Excel sheet), but the inconsistency made me fail (some entries are spawned multiple lines, the "names" do not have fixed no. of fields).
Can someone come up with any idea that will make it possible to copy the first list in PDF to a spreadsheet in tabular form exactly as the original file?
For a background about why the PDF file format should never, ever be thought of as suitable for hosting extractable, structured data, see this article:
Why Updating Dollars for Docs Was So Difficult
For an amazing open source family of tools that gets better and better from week to week for extracting tabular data from PDFs (unless they are scanned pages) -- contradicting point '1.' above! -- see these links:
Introducing Tabula: Upload a PDF, get back tabular CSV data. Poof!
Tabula-Extractor: A Command Line Interface to Tabula
Tabula source code repository
Tabula API (upcoming, not ready yet)
Well I sort of managed it. I first copied it to a plain text file, deleted all letters from it leaving only the serial number and corresponding marks, separated by spaces or tabs. Then using "import" in an OpenOffice Spreadsheet, told it the delimiters are spaces and tabs (combine them if necessary) and bingo! I got my rank.
But I would still like to know if it's possible to copy the whole table as it is. So keeping this question open.
I once was tasked with building a parser which would extract data from a pdf with tabular and non-tabular data in a number of different encodings and with a mix a rtl and ltr text. That project took quite the effort but with a simple English table you should be able to dissect the pdf in no time. Look for the PDF specs on adobe.com and if it is that desperate start digging in.
Also you'll first need to use pdftk.exe to uncompress the file.
A shortcut that me be of aid:
http://www.adobe.com/devnet/pdf/pdf_reference.html
This is the shortcut I meant: http://www.codeproject.com/KB/cs/PDFToText.aspx