how to ignore a folder in a given location - mercurial - mercurial

How can ignore the folder called build in the root of my project, but not ignore a folder called build anywhere else?
i.e.
/myprog/.hgignore
/myproj/make
/myproj/build <-ignore this
/myproj/lib/somelib/build <- dont ignore this

You could use the regexp syntax as per doc.
Your .hgignore should then contain
syntax: regexp
^build

You can use the .hgignore file. You will want to add a line
/myproj/build

Related

I can't find my MySQL folder in %ProgramData%

First of all, I just want to say that I'm new to SQL, so forgive me if I'm being ignorant or something.
I'm working on this project and I need to import data from a text file. My first thought was to use this command:
LOAD DATA LOCAL INFILE '/tmp/test.txt' INTO TABLE names;
Where my text file is test and my table is names.
However, I got this error message:
Error Code: 2. File '\tmp\teste.txt' not found (Errcode: 2 - No such file or directory)
I tried to save this file in the tmp folder but I still got this same error. I was told that maybe the problem is in my.ini (something about the --secure-file-priv) but I just can't find my MySQL folder in C:\ProgramData. Apparently, that is where my.ini is supposed to be. So, any ideas of what is going on?
By the way, I'm not confusing C:\Program Files and C:\ProgramData
P.S: I use Windows 10 and MySQL Workbench 6.3 CE.
Alright pals, the problem is solved. I honestly don't know how I managed to find the problem but I did and as expected, it was a silly one. The correct statement would be:
load data infile 'c:\\wamp\\tmp\\test.txt' into table names;
I got confused with all that slashes thing, because for directories you use \ or /. So my mistake was doing this:
load data infile 'c:\wamp\tmp\test.txt' into table names;
Using only one backslash instead of two, which is wrong. Finally, I just needed to put my text file in the tmp folder and use the appropriate backslashes (no need for LOCAL). Thanks for the help!

Csv parser - Evaluate header for each file

I have multiple CSV files in a directory. They may have different column combinations, but I would like to COPY them all with a single command, as there is a lot of them and they all go into same table. But the FDelimitedParser only evaluates the header row for the first file, then rejects all rows that do not fit - ie. all rows from most of the other files. I've been using FDelimitedParser but anything else is fine.
1 - Is this expected behavior, and if so, why ?
2 - I want it to evaluate the headers for each file, is there a way ?
Thanks
(Vertica 7.2)
Looks like you need flexTable for that , see http://vertica-howto.info/2014/07/how-to-load-csv-files-into-flex-tables/
Here's a small workaround that I use when I need to load a bunch of files in at once. This assumes all your files have the same column order.
Download and run Cygwin
Navigate to folder with csv files
cd your_folder_name_with_csv_files
Combine all csv files into a new file
cat *.csv >> new_file_name.csv
Run a copy statement in Vertica from new file. If file headers are an issue, you can follow instructions on this link and run through Cygwin to remove the first line from every file.

How to select directories in bash from sql table

I have a directory containing more than 1100 directories, i want to move about 400 directories which name i have stored in a sql table? Is there a way to achieve this? I have searched on google but i can't find anything. Maybe one possiblity should be to export the table records to a text file but i still don't know how to connect the text file to the directories. Thanks.
#!/bin/bash
DIRLIST='file'
SOURCE='/my/source/directory'
TARGET='/my/target/directory'
while read -r dir; do
echo mv "$SOURCE/$dir" "$TARGET"
done < "$DIRLIST"
where file contains
directory1
directory2
directory3
(customize the example to your specific taste, and remove the echo statement in front of the mv after testing)

How to exclude a specific folder from ignored list in .hgignore

I have some temp folders in my source tree. I am ignoring them all in .hgignore like below
temp/
It is ignoring all the temp folders e.g.
a/temp
b/temp
a/c/temp
b/d/temp
But I want a specific temp folder for example "a/c/temp" to include in the repository. So I excluded it in .hgignore like below.
!a/c/temp
/temp
But it is not working. "a/c/temp" folder is still being ignored.
Any idea?
You need something like that (Negative Lookahead):
syntax: regexp
^(?!a/c).*/temp
and if you want to exlude more directories, for example b/d/temp
syntax: regexp
^(?!a/c|b/d).*/temp
I hope that helps.

load data local infile ERROR 2 file not found

I've been ramming my face against this sql error for about 45 minutes, and I have a feeling it's going to be something silly.
I'm trying to load a .txt file into my database, which is on a server elsewhere. I'm using putty on windows 7.
The sql call I am using is the following:
LOAD DATA LOCAL INFILE "C:/Users/Sam/Desktop/students_data.txt" INTO TABLE students;
The response I get is ERROR 2 (HYOOO): File 'C:/Users/Sam/Desktop/students_data.txt' not found (Errcode:2)
If anyone could shed some light on this that'd be extravagant. I already tried switching the / to \ and using single quotes, etc., but nothing seems to work. The file path is copied by shift+clicking the actual file and pasting it.
I have found a solution. First delete the word LOCAL from the sql statement. Second - place your file into MySQL DATA folder usually - bin/mysql/msql5.5.8/data/and your DB with which you are working. It worked for me. You might want to check your MAX_FILE upload number in php.ini file if file is large.
Removing the word LOCAL seemed to work for me; try it out!
Try to type path as C:\\mydir\\myfile.csv i.e. use \\ instead of \
I had this problem too, then I read this:
The file name must be given as a literal string. On Windows, specify
backslashes in path names as forward slashes or doubled backslashes
(from http://dev.mysql.com/doc/refman/5.1/en/load-data.html)
I did use the LOCAL keyword, but escaped the file path like this: str_replace('\\','/',$file), then it worked like a charm!
Had this too and solved it by using cmd.exe and found that the filename was mistakenly in the form filename.txt.txt and fixed it.
just replace "\" by "/" as the path directory before the filename.txt in (""). it will be better if u just keep the file in mysql data folder and do the thing i mentioned above.it will definitely work.
Sorry my previous answer is wrong.
In my case, I connect to a proxy, not the real physical mysql instance, so of course it could not get my local file.
To solve this, figure out the true physical mysql instance IP, connect it directly. You need help from the DBA.
LOAD DATA LOCAL INFILE 'C:\\cygwin\\home\\jml58z\\e_npv\\Fn_awk2010.mysql' INTO TABLE mydata
with the double \ it worked